Rotació en 2D

La matriu de rotació en dues dimensions es representa així:

\[ R(\theta) = \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} \]

Donat un punt inicial \( (x_1, y_1) \), el punt rotat \( (x_2, y_2) \) després de la rotació és:

\[ \begin{bmatrix} x_2 \\ y_2 \end{bmatrix} = \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} \begin{bmatrix} x_1 \\ y_1 \end{bmatrix} \]