hmm for cos(pi/2+theta) i get cos(pi/2+theta) = sin(theta), I am guessing it should be -sin(theta)
Looking at the unit circle, adding pi/2 to an angle in the first quadrant gives and angle in the second quadrant where the "x" coordinate is negative. You should also be able to see that the vertical and horizontal sides of the right triangles formed (|x| and |y|) are swapped. That is (x, y), in the first quadrant, with both x and y positive, is rotated to (-y, x).
Since, on the unit circle, the first coordinate is [itex]cos(\theta)[/itex] and the second coordinate is [itex]sin(theta)[/itex], [itex]cos(\theta+ \pi/2)= -y= -sin(\theta)[/itex].