# 12. Rotations

## 12. Rotations

We'll analyse some examples of 3-by-3 rotation matrices, and then see to figure out the axis and angle of rotation for a general 3-by-3 rotation matrix.

### Example 1

Let $A=\begin{pmatrix}\cos\theta&-\sin\theta&0\\ \sin\theta&\cos\theta&0\\ 0&0&1\end{pmatrix}$ . This is an example of a 3-by-3 rotation matrix. The top-left 2-by-2 block rotates the $xy$ -plane, and the 1 in the bottom-right tells us that the $z$ -axis is fixed. More precisely: $\begin{pmatrix}\cos\theta&-\sin\theta&0\\ \sin\theta&\cos\theta&0\\ 0&0&1\end{pmatrix}\begin{pmatrix}x\\ y\\ z\end{pmatrix}=\begin{pmatrix}x\cos\theta-y\sin\theta\\ x\sin\theta+y\cos\theta\\ z\end{pmatrix},$ so the vectors $\begin{pmatrix}x\\ y\\ 0\end{pmatrix}$ in the $xy$ -plane get rotated by the 2-by-2 rotation matrix $\begin{pmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{pmatrix}$ , and the vector $\begin{pmatrix}0\\ 0\\ 1\end{pmatrix}$ which points along the $z$ -axis is fixed.

A key point here is that the axis of rotation is fixed, i.e. any vector $u$ pointing in the $z$ -direction satisfies $u=Au$ .

### Example 2

Let $B=\begin{pmatrix}0&0&1\\ 0&1&0\\ -1&0&0\end{pmatrix}$ . This is another example of a 3-by-3 rotation matrix. What is the axis of rotation? We need to find a vector $u=\begin{pmatrix}x\\ y\\ z\end{pmatrix}$ such that $u=Bu$ . In other words, $\begin{pmatrix}x\\ y\\ z\end{pmatrix}=\begin{pmatrix}0&0&1\\ 0&1&0\\ -1&0&0\end{pmatrix}\begin{pmatrix}x\\ y\\ z\end{pmatrix}=\begin{pmatrix}z\\ y\\ -x\end{pmatrix}.$ This is three equations (one for each component): $x=z,\qquad y=y,\qquad-x=z.$ The equation $y=y$ is trivially satisfied. The other two equations imply $x=z=0$ . Therefore $u=\begin{pmatrix}0\\ y\\ 0\end{pmatrix}$ , and $u$ must point along the $y$ -axis.

By comparing with Example 1, the angle of rotation can be found by:

• taking a vector $v$ which lives in the plane orthogonal to the axis,

• applying $B$ to get $Bv$ ,

• computing the angle between $v$ and $Bv$ using dot products.

For example, we could take $v=\begin{pmatrix}1\\ 0\\ 0\end{pmatrix}$ (as $v\cdot u=0$ so $v$ is orthogonal to the axis). Then $Bv=\begin{pmatrix}0\\ 0\\ -1\end{pmatrix}$ , so $v\cdot Bv=0$ . If $\theta$ is the angle between $v$ and $Bv$ then this implies $\cos\theta=0$ , so $\theta=\pm 90$ degrees.

In fact, we can understand exactly what this rotation is doing by drawing the images of the basis vectors $e_{1},e_{2},e_{3}$ under $B$ (i.e. the three columns of $B$ ). The vector $e_{2}$ is fixed, $e_{3}$ goes to $e_{1}$ and $e_{1}$ goes to $-e_{3}$ , so this rotates by 90 degrees about the $y$ -axis, sending the positive $z$ -axis to the positive $x$ -axis.

### Example 3

Take $C=\begin{pmatrix}0&0&1\\ 1&0&0\\ 0&1&0\end{pmatrix}$ . This is another 3-by-3 rotation matrix; we'll find the axis and angle of rotation.

Remark:

These examples are carefully chosen to be rotation matrices. Note that if I gave you a random 3-by-3 matrix, it probably wouldn't be a rotation matrix, and isn't guaranteed to have any fixed vectors at all.

To find the axis $u=\begin{pmatrix}x\\ y\\ z\end{pmatrix}$ , we need to solve $u=Cu$ : $\begin{pmatrix}x\\ y\\ z\end{pmatrix}=\begin{pmatrix}0&0&1\\ 1&0&0\\ 0&1&0\end{pmatrix}\begin{pmatrix}x\\ y\\ z\end{pmatrix}=\begin{pmatrix}z\\ x\\ y\end{pmatrix}.$ The first two equations imply $x=y=z$ , so the third is redundant, and any vector of the form $u=\begin{pmatrix}x\\ x\\ x\end{pmatrix}$ is fixed. In other words, the axis points in the $\begin{pmatrix}1\\ 1\\ 1\end{pmatrix}$ -direction.

To find the angle, pick a vector $v$ orthogonal to $u$ . For example, $v=\begin{pmatrix}1\\ -1\\ 0\end{pmatrix}$ satisfies $u\cdot v=0$ so is orthogonal to $u$ . We compute $v\cdot Cv=\begin{pmatrix}1\\ -1\\ 0\end{pmatrix}\cdot\begin{pmatrix}0\\ 1\\ -1\end{pmatrix}=-1.$ We also know that if $\theta$ is the angle between $v$ and $Cv$ then $-1=v\cdot Cv=|v||Cv|\cos\theta$ . Since $|v|=|Cv|=\sqrt{2}$ , we get $\cos\theta=-1/2.$ This tells us that $\theta$ is $2\pi/3$ (or any of the other values that have $\cos\theta=-1/2$ ). Let's draw a picture to convince ourselves it's really $2\pi/3$ (120 degrees).

The axis of rotation points out of the screen: