Sine and cosine are used only when you want to convert from an angle representation to a vector representation. But let's first analyze what makes a matrix a rotation matrix.
Rotation matrices are ortho-normal and have determinant +1. That means that their column vectors are of unit length and that they are perpendicular to each other. One nice property of ortho-normal matrices is that you can invert them by transposing them. But that's just a nice feature.
If we have the 2D rotation matrix
M = / cos a sin a \
\ -sin a cos a /
, we see that this is the case. The first column vector is (cos a, -sin a)
. From the Pythagorean theorem, we get that this vector has unit length. Furthermore, it is perpendicular to the second column vector (their dot product is zero).
So far, so good. This matrix is a rotation matrix. But can we interpret the column vectors? Indeed, we can. The first column vector is the image of the vector (1, 0)
(i.e. the right vector). The second column vector is the image of the vector (0, 1)
(i.e. the up vector).
So you see that using sine and cosine are just another way to calculate the direction vectors. Doing so automatically ensures that they have unit length and that they are orthogonal to each other. But this is just one way. You can also calculate the direction vectors using the cross product or any other scheme. The critical point is that the rotation matrix properties are fulfilled.