Hello I am confused about rotation matrices
I can either rotate a point in one direction directly or rotate its base vector in the opposite direction and then project the point onto the rotated base vectors, right?
Let's say I have vectors $(1,0)$ and $(0,1)$ (Cartesian base) and rotate those vectors so I get $v_1 = (\cos a, \sin a)$ and $v_2 = (-\sin a, \cos a)$
Now the last step is the projection.
$$\begin{align*} p.x' &= \mathrm{proj}(p)\,\mathrm{to}\,v_1 = \mathrm{dot}(p,v_1) = p.x \cdot \cos a + p.y \cdot \sin a \\ p.y' &= \mathrm{proj}(p)\,\mathrm{to}\,v_2 = \mathrm{dot}(p,v_2) = -p.x \cdot \sin a + p.y \cdot \cos a \end{align*}$$
On the other hand, rotation matrix looks like this:
$$\left[ \begin{matrix} \cos a & -\sin a\\ \sin a & \cos a \end{matrix} \right]$$
and multiplying it by point $p$ I get
$$\begin{align*} p.x' &= p.x \cdot \cos a - p.y \cdot \sin a \\ p.y' &= p.x \cdot \sin a + p.y \cdot \cos a \end{align*}$$
Which gives me different results...what am I missing??
Thanks for your time guys (girls)!
Remember that you need to rotate in the opposite direction. That means that you should replace $a$ with $-a$. The cosine term is the same, the sine term changes sign