Constructing a simple 2-d rotation matrix. My understanding was that if you take a matrix whose columns are a bunch of orthonormal vectors that span the whole space, you get a rotation matrix, where the rotation takes you from current basis to the basis described by those orthonormal vectors. I tried to apply this concept to recreate a 2-d rotation matrix. If I rotate the x and y axes by an angle, $\theta$, what I get is two vectors, $(\cos(\theta), \sin(\theta))$ and $(\sin(\theta), -\cos(\theta))$ (see figure at very bottom). Including them as columns of a matrix yields:
$$
R = \begin{pmatrix}
\cos(\theta) & \sin(\theta) \\
\sin(\theta) & -\cos(\theta)
\end{pmatrix}
$$
But this is different from the rotation matrix we know:
$$
R = \begin{pmatrix}
\cos(\theta) & -\sin(\theta) \\
\sin(\theta) & \cos(\theta)
\end{pmatrix}
$$
Where did I go wrong?

 A: The mistake is that orthonormal bases come in two opposite orientations, called left handed and right handed. Undoubtedly you remember from high school physics that $\vec{u}$, $\vec{v}$ and $\vec{u}\times\vec{v}$ typically form a right handed set (in that order). Thumb, index finger, middle finger and all that. The division exists in all dimensions though we typically first hear about in 3D. In the current context $R$ is a change of bases matrix. The matrix $R$ takes one orthonormal basis to another if and only if $R^{-1}=R^T$, whence $\det R=\pm1$. If $\det R=+1$, then it takes a right-handed orthonormal basis to another right-handed system. But if $\det R=-1$, then the handedness is reversed.

Look at your image. Place the thumb of your right hand along the original $x$-axis, and the index finger along the $y$-axis. Your middle finger will point towards you (from the screen). If you do the same with the other two vectors, you notice that the middle finger will point away. The handedness is reverse, and that shows in the determinant.
Handedness can be fixed by replacing one of the orthonormal vectors $\vec{v}$ with the opposite vector $-\vec{v}$. Or by permuting any two vectors. More generally, odd permutations of basis vectors change the handedness while even permutations keep it.
One more remark. The space itself has no preferred handedness (at least not mathematically, particle physicists may disagree). Therefore it is somewhat incorrect to call a basis right-handed without specifying a reference basis. In 3D, once you have drawn $\vec{i},\vec{j},\vec{k}$, you have given a reference basis, and we can use the determinant, as above, to check whether some other orthonormal basis shares the same orientation or not.
A: If we rotate the vector $(0,1)$ counterclockwise we obtain $(-\sin(\theta), \cos(\theta))$ which leads to the correct rotation matrix (according to the usual convention for cartesian axes)
$$R_1 = \begin{pmatrix}
\cos(\theta) & -\sin(\theta) \\
\sin(\theta) & \cos(\theta)
\end{pmatrix}$$
The other rotation matrix, if we consider $y$ axis reversed would be
$$R_2 = \begin{pmatrix}
\cos(\theta) & \sin(\theta) \\
-\sin(\theta) & \cos(\theta)
\end{pmatrix}$$

