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.

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))$.