Matrices – Representing Rotation by an Angle Using Transformation Matrix

matricestransformationtrigonometry

$$
\begin{pmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{pmatrix}
$$

How was this matrix derived? I know how to use it, but where did it come from? Can someone prove why this matrix represents a rotation about the origin by an angle theta?

Best Answer

Consider what happens when we take a point $(x,y)$ and rotate it by an angle of $\theta$.

enter image description here

Using polar coordinates, we can write $(x,y) = (r\cos \phi,r\sin \phi)$ where $r$ is the distance from $(x,y)$ to the origin and $\phi$ is the angle made by the line from the origin to $(x,y)$ and the positive $x$-axis.

After rotating $(x,y)$ by an angle of $\theta$, the new point is still $r$ units away from the origin, but now, the angle made by the line from the origin to $(x',y')$ and the positive $x$-axis increases by $\theta$. Hence, $(x',y') = (r\cos(\phi+\theta),r\sin(\phi+\theta))$.

Now, let's use the cosine and sine sum of angle formulas to write $x'$ and $y'$ in terms of $x$ and $y$:

$$x' = r\cos(\phi+\theta) = r\cos\phi\cos\theta - r\sin\phi\sin\theta = x\cos\theta - y\sin\theta$$

$$y' = r\sin(\phi+\theta) = r\sin\phi\cos\theta + r\cos\phi\sin\theta = y\cos\theta + x\sin\theta$$

Putting this into matrix form gives us:

$$\begin{pmatrix}x' \\ y'\end{pmatrix} = \begin{pmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{pmatrix}\begin{pmatrix}x \\ y\end{pmatrix}$$

Hence, the matrix which rotates a point by an angle of $\theta$ counterclockwise is $\begin{pmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{pmatrix}$.

Remark: To add to what David C. Ullrich suggested, notice that the columns of this matrix $\begin{pmatrix}\cos\theta \\ \sin\theta \end{pmatrix}$ and $\begin{pmatrix}-\sin\theta\\ \cos\theta\end{pmatrix}$ are precisely the result of rotating the vectors $\begin{pmatrix}1 \\ 0 \end{pmatrix}$ and $\begin{pmatrix}0 \\ 1 \end{pmatrix}$ counterclockwise about the origin by an angle of $\theta$. This same property holds for other linear transformations. Specifically, the $j$-th column of the matrix of a transformation is the result of applying the transformation to the $j$-th basis vector.