How Trig Cofunctions Relate to Transformations

Hi, could somebody clear this up.

cosx=sinpi/2-x

I must be doing something wrong, because as far as I'm aware this is

sin(-x) which should transform the sin graph by flipping it around the y axis, followed by sin((-x)+pi/2) which should shift the graph backward by pi/2. However this graph looks like cosx flipped around the x axis..?

Alternatively I call this sin-(x-pi/2), so that's sin((x)-pi/2) which shifts the graph to the right by 1/4 of a period, then sin-((x)-pi/2) which flips it around the y axis, although by this time the graph is symmetrical about the axis anyway and so, again, I end up with cos(-x), cosx flipped around the x axis.

So in conclusion by transforming I'm finding that -cosx=sinpi/2-x, which is wrong. What's up?

Thanks. :D