## A reflection followed by a reflection is a rotation

In preparation for answering exercise 2.6.3 in Gilbert Strang’s Linear Algebra and Its Applications, Third Edition, I wanted to derive in detail the effect of a reflection followed by a reflection, a reflection followed by a rotation, and a rotation followed by a reflection. This post demonstrates that a reflection followed by a reflection is equivalent to a rotation.

Assume that we have a matrix that reflects vectors in the line through the origin with angle $\theta$ (the $\theta$-line) and a second matrix that reflects vectors in the line through the origin with angle $\varphi$ (the $\varphi$-line). What is the effect of applying both matrices in succession?

One way to gain an intuition about the problem is to play with a cut-out paper triangle on a piece of paper on which you’ve drawn the two lines of reflection. (Or, if your visualization skills are strong, you can imagine doing this.) After trying this you should find that two reflections will apparently cause the triangle to be rotated from its original position.

If this is indeed the case then the effect of successive reflections in the $\theta$-line and the $\varphi$-line can be represented by a matrix

$Q_\omega = \begin{bmatrix} \cos \omega&-\sin \omega \\ \sin \omega&\cos \omega \end{bmatrix}$

for some angle of rotation $\omega$.

How does the angle $\omega$ relate to the angles $\theta$ and $\varphi$? Since we are dealing with linear transformations the simplest assumption is that $\omega = a\theta + b\varphi$ for some $a$ and $b$ where $a$ and $b$ are the same for all $\theta$ and $\varphi$.

To determine the values of $a$ and $b$ let’s look at the unit vector $(1, 0)$ and reflect it in two lines. In the first case we reflect the vector in the $45^{\circ}$-line (the line for which $y = x$) and then in the $90^{\circ}$-line (the $y$-axis). The first reflection takes $(1,0)$ to $(0,1)$ and the second reflection leaves it unchanged. The corresponding angle of rotation is  $90^{\circ}$.

In the second case we reflect vector $(1,0)$ in the $45^{\circ}$-line and then in the $135^{\circ}$-line (the line for which $y = -x$). The first reflection takes $(1,0)$ to $(0,1)$ and the second reflection takes $(0,1)$ to $(-1,0)$. The corresponding angle of rotation is  $180^{\circ}$.

If the angle of rotation $\omega = a\theta + b\varphi$ then in the first case we would have $90 = 45a + 90b$ and in the second case we would have $180 = 45a + 135b$. Subtracting the first equation from the second we have $90 = 45b$ or $b = 2$. Substituting the value of $b$ into the first equation we have $90 = 45a + 180$ or $a = -2$.

Our hypothesis is therefore that doing two reflections in succession in the $\theta$-line and then the $\varphi$-line would produce a rotation through the angle $\omega = -2\theta + 2\varphi = 2(\varphi - \theta)$. If this is the case then the matrix representing the rotation would be

$Q_{2(\varphi - \theta)} = \begin{bmatrix} \cos 2(\varphi - \theta)&-\sin 2(\varphi-\theta) \\ \sin 2(\varphi-\theta)&\cos 2(\varphi-\theta) \end{bmatrix}$

and this matrix should be equal to the product of the matrices corresponding to the two reflections

$H_\varphi H_\theta = \begin{bmatrix} 2\cos^2 \varphi - 1&2\cos\varphi\sin\varphi \\ 2\cos\varphi\sin\varphi&2\sin^2 \varphi - 1 \end{bmatrix} \begin{bmatrix} 2\cos^2 \theta - 1&2\cos\theta\sin\theta \\ 2\cos\theta\sin\theta&2\sin^2 \theta - 1 \end{bmatrix}$

Note that the entries of these matrices are expressed in terms of the sine and cosine of $\theta$ and $\varphi$ while in the hypothesized matrix $Q_{2(\varphi - \theta)}$ the entries are expressed in terms of the sine and cosine of an expression containing $2\theta$ and $2\varphi$. As a start toward proving that $H_\varphi H_\theta = Q_{2(\varphi - \theta)}$ it might be useful to re-express $H_\varphi$ and $H_\theta$ in terms of the sine and cosine of $2\theta$ and $2\varphi$ as well.

If we look at the trigonometric identities

$\begin{array}{rcl} \cos (\theta_1 + \theta_2)&=&\cos \theta_1 \cos \theta_2 - \sin \theta_1 \sin \theta_2 \\ \sin (\theta_1 + \theta_2)&=&\sin \theta_1 \cos \theta_2 + \cos \theta_1 \sin \theta_2 \end{array}$

we see that

$\begin{array}{rcrcrcl} \cos 2\theta&=&\cos (\theta + \theta)&=&\cos \theta \cos \theta - \sin \theta \sin \theta&=&\cos^2 \theta - \sin^2 \theta \\ \sin 2\theta&=&\sin (\theta + \theta)&=&\sin \theta \cos \theta + \cos \theta \sin \theta&=&2\cos \theta \sin \theta \end{array}$

and similarly for $\cos 2\varphi$ and $\sin 2\varphi$.

Using the second identity we can re-express the product of the two reflection matrices as

$H_\varphi H_\theta = \begin{bmatrix} 2\cos^2 \varphi - 1&\sin 2\varphi \\ \sin 2\varphi&2\sin^2 \varphi - 1 \end{bmatrix} \begin{bmatrix} 2\cos^2 \theta - 1&\sin 2\theta \\ \sin 2\theta&2\sin^2 \theta - 1 \end{bmatrix}$

What about the other entries still expressed in terms of the sine and cosine of $\theta$ and $\varphi$? Using the identity $\sin^2 \theta + \cos^2 \theta = 1$ we see that

$2\cos^2 \theta - 1 = 2\cos^2 \theta - (\sin^2 \theta + \cos^2 \theta)$

$= \cos^2 \theta - \sin^2 \theta = \cos 2\theta$

and

$2\sin^2 \theta - 1 = 2\sin^2 \theta - (\sin^2 \theta + \cos^2 \theta)$

$= \sin^2 \theta - \cos^2 \theta = -(\cos^2 \theta - \sin^2 \theta) = -\cos 2\theta$

This allows us to re-express the product of the two reflection matrices as

$H_\varphi H_\theta = \begin{bmatrix} \cos 2\varphi&\sin 2\varphi \\ \sin 2\varphi&-\cos 2\varphi \end{bmatrix} \begin{bmatrix} \cos 2\theta&\sin 2\theta \\ \sin 2\theta&-\cos 2\theta \end{bmatrix}$

$= \begin{bmatrix} \cos 2\varphi \cos 2\theta + \sin 2\varphi \sin 2\theta&\cos 2\varphi \sin 2\theta - \sin 2\varphi \cos 2\theta \\ \sin 2\varphi \cos 2\theta - \cos 2\varphi \sin 2\theta&\sin 2\varphi \sin 2\theta + \cos 2\varphi \cos 2\theta \end{bmatrix}$

We can further simplify this using the trigonometric identities

$\begin{array}{rcl} \cos (\theta_1 - \theta_2)&=&\cos \theta_1 \cos \theta_2 + \sin \theta_1 \sin \theta_2 \\ \sin (\theta_1 - \theta_2)&=&\sin \theta_1 \cos \theta_2 - \cos \theta_1 \sin \theta_2 \end{array}$

(Note that these follow from the original identities above and the fact that $\cos (-\theta_2) = \cos \theta_2$ and $\sin (-\theta_2) = -\sin \theta_2$.)

We then have

$H_\varphi H_\theta = \begin{bmatrix} \cos 2\varphi \cos 2\theta + \sin 2\varphi \sin 2\theta&-(\sin 2\varphi \cos 2\theta - \cos 2\varphi \sin 2\theta) \\ \sin 2\varphi \cos 2\theta - \cos 2\varphi \sin 2\theta&\cos 2\varphi \cos 2\theta + \sin 2\varphi \sin 2\theta \end{bmatrix}$

$= \begin{bmatrix} \cos (2\varphi - 2\theta)&-\sin (2\varphi - 2\theta) \\ \sin (2\varphi - 2\theta)&\cos (2\varphi - 2\theta) \end{bmatrix}$

$= \begin{bmatrix} \cos 2(\varphi - \theta)&-\sin 2(\varphi-\theta) \\ \sin 2(\varphi-\theta)&\cos 2(\varphi-\theta) \end{bmatrix} = Q_{2(\varphi-\theta})$

We have therefore proved what we set out to prove, that $H_\varphi H_\theta = Q_{2(\varphi-\theta)}$ so that the effect of applying a reflection through the $\theta$-line followed by a second reflection through the $\varphi$-line is equivalent to a rotation through the angle $2(\varphi - \theta)$.

Note that if we instead first reflect through the $\varphi$-line and then through the $\theta$-line then this is equivalent to rotating through the angle $2(\theta-\varphi)$ instead of through the angle $2(\varphi-\theta)$.  We therefore have $H_\varphi H_\theta \ne H_\theta H_\varphi$ except in the cases where $\varphi = \theta$ or (more generally) the two angles differ by a multiple of $360^{\circ}$. (The general case is because for any angle $\omega$ we have $\sin \omega = \sin (\omega + 360^{\circ})$ and likewise for the cosine.) In that case $H_\varphi H_\theta = H_\theta H_\theta = I$ and the equivalent rotation matrix is $Q_{2(\varphi-\theta)} = Q_{2(\theta-\theta)} =Q_0$ corresponding to rotation through the zero angle.

For example, above we took the unit vector $(1, 0)$ and reflected it in the $45^{\circ}$-line (the line for which $y = x$) and then in the $90^{\circ}$-line (the $y$-axis). The first reflection takes $(1,0)$ to $(0,1)$ and the second reflection leaves it unchanged. The corresponding angle of rotation is  $90^{\circ} = 2 \cdot (90^{\circ}-45^{\circ})$. If instead we take $(1, 0)$ and reflect it first in the $90^{\circ}$-line and then in the $45^{\circ}$-line then this takes $(1,0)$ to $(-1,0)$ and then to $(0,-1)$. The corresponding angle of rotation is  $-90^{\circ} = 2 \cdot (45^{\circ}-90^{\circ})$.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

This entry was posted in linear algebra. Bookmark the permalink.