# What does negative sine mean in this diagram?

I thought cos was x and sin was y. In quadrant two, cos is negative and sin is positive. Why does this diagram have a negative sign as the x-coord and cos as the y coordinate for q prime's vector?

The diagram comes from a book on 3D mathematics. The blue line represents a basis vector.

-
Note that the angle in quadrant two is still below $\frac{\pi}{2}$ as it starts at the $y$-axis. So both $\cos(\theta)$ and $\sin(\theta)$ are positive, but in order to have a point in the second quadrant you need a negative $x$-coordinate. –  martin.koeberl Dec 19 '12 at 9:09

Rotating a point $(x,y)$ $90^\circ$ counterclockwise about the origin gives the point $(-y,x)$.

Note that the two vectors are perpendicular $$(x,y)\cdot(-y,x)=-xy+xy=0$$ and have the same length $$x^2+y^2=(-y)^2+x^2$$ Thus, rotating the point $(\cos(\theta),\sin(\theta))$ $90^\circ$ counterclockwise about the origin gives the point $(-\sin(\theta),\cos(\theta))$.

-
Look at the coordinates of $\mathbf{p'}$: the $x$-coordinate is $\cos\theta$, and the $y$-coordinate is $\sin\theta$. Let $O$ be the origin, $P$ the point $(\cos\theta,\sin\theta)$ at the end of the vector $\mathbf{p'}$, and $X$ the point $(\cos\theta,0)$ directly below $P$ on the $x$-axis. If you rotate the triangle $\triangle OPX$ $90^\circ$ counterclockwise about the origin, $O$ stays where it is, $P$ moves to the point $Q$ at the end of the vector $\mathbf{q'}$, and $X$ moves to a point $Y$ on the $y$-axis directly to the left of $Q$. The triangle $\triangle OQY$ is therefore congruent to $OPX$, which means that $|QY|=|PX|$ and $|OY|=|OX|$. Since $Q$ is in the second quadrant, its $x$-coordinate is negative and must therefore be $-|QY|=-|PX|=-\sin\theta$. Its $y$-coordinate, however, is positive, like the $x$-coordinate of $P$, so it’s $|OY|=|OX|=\cos\theta$.
Of course this reasoning applies in this form only when $\theta$ is in the first quadrant. More generally, you’re just adding $\frac{\pi}2$ to $\theta$ when you rotate the vector about the origin, so the coordinates of $Q$ are
$$x\text{-coordinate}=\cos\left(\theta+\frac{\pi}2\right)=\cos\theta\cos\frac{\pi}2-\sin\theta\sin\frac{\pi}2=-\sin\theta$$
$$y\text{-coordinate}=\sin\left(\theta+\frac{pi}2\right)=\sin\theta\cos\frac{\pi}2-\cos\theta\sin\frac{\pi}2=\cos\theta\;.$$