Rotating a Matrix by an angle

737 Views Asked by At

So I have a matrix like so

\begin{pmatrix} x_0 & x_1 & x_2 & x_3 \\ y_0 & y_1 & y_2 & y_3 \end{pmatrix}

And I need rotate the matrix by an angle - for say $45$ degrees.

I read that the rotation matrix is

\begin{pmatrix} \cos(45^\circ) & \sin(45^\circ) & \\ -\sin(45^\circ) & \cos(45^\circ) \\ \end{pmatrix}

Now my question is how do I apply that to my matrix? I mean in the rotation matrix there are 2 elements for $ x$ and $2$ for y and I don't know to while elements in my matrix apply which $x$ or $y$ elements from the rotation matrix..

1

There are 1 best solutions below

4
On BEST ANSWER

Rotation of point $(x,y)$ in a plane is two mapping like this: $u = f(x,y)$ and $v=g(x,y)$

here $$ u = \begin{bmatrix} \cos(45^0) & \sin(45^0) \end{bmatrix} . \begin{bmatrix} x \\ y \end{bmatrix} =\frac1{\sqrt2}(x+y) $$

and similarly $$ v = \begin{bmatrix} -\sin(45^0) & \cos(45^0) \end{bmatrix} . \begin{bmatrix} x \\ y \end{bmatrix} = \frac1{\sqrt2}(y-x) $$

So when you want to rotate many points, first you store them in a matrix like : $$ X =\begin{pmatrix} x_0 & x_1 & x_2 & x_3 \\ y_0 & y_1 & y_2 & y_3 \end{pmatrix} $$ then multiply the rotation matrix from left by matrix of points ($RX$).

This could be considered rotation of several points