Why the Order of Two Actions Matters
In the plane, rotating a vector and reflecting it are each simple transformations. Applying both is also straightforward, but the order of the actions can change the result. To keep the comparison precise, we will use a rotation about the origin and a reflection across the \(x\)-axis. We will compute both possible orders and test them on vectors, including a case where the two orders happen to agree.
Vectors in \(\mathbb{R}^2\) are columns. Let \(R_\theta:\mathbb{R}^2\to\mathbb{R}^2\) be counterclockwise rotation through an angle \(\theta\), and let \(S:\mathbb{R}^2\to\mathbb{R}^2\) be reflection across the \(x\)-axis. Their standard matrices are
Thus \(S(x,y)=(x,-y)\), while \(R_\theta(x,y)=(x\cos\theta-y\sin\theta,\;x\sin\theta+y\cos\theta)\). For composition, \(S\circ R_\theta\) means apply \(R_\theta\) first and then \(S\). Its matrix is \(\mathbf{S}\mathbf{R}_\theta\): the matrix for the action performed last is on the left. Conversely, \(R_\theta\circ S\), reflection first and rotation second, has matrix \(\mathbf{R}_\theta\mathbf{S}\).
Compute the Two Products
Write \(c=\cos\theta\) and \(s=\sin\theta\) to keep the multiplication readable. Multiplying in the order for rotation followed by reflection gives
For reflection followed by rotation, multiply in the reverse order:
The products differ in the signs of their off-diagonal entries. That observation suggests how to compare them, but the meaning of the difference is easiest to see by applying each composite to the same input.
Proof. The standard matrix for a composition is the product of the matrices in reverse order of the actions: the first action is applied to the input first, and the matrix of the second action multiplies its output. Therefore the two matrices are respectively \(\mathbf{S}\mathbf{R}_\theta\) and \(\mathbf{R}_\theta\mathbf{S}\). In the first product, the first row remains \((c,-s)\), and the second row of \(\mathbf{R}_\theta\) is multiplied by \(-1\), giving \((-s,-c)\). In the second product, multiplying on the right by \(\mathbf{S}\) leaves the first column unchanged and multiplies the second column by \(-1\), giving columns \((c,s)^\top\) and \((s,-c)^\top\). Substituting \(c=\cos\theta\) and \(s=\sin\theta\) gives the stated matrices. \(\square\)
Worked Comparisons
Worked Example: A Quarter-Turn and the x-Axis Reflection
Compare rotation through \(\theta=\frac{\pi}{2}\) followed by reflection with reflection followed by that rotation. Use the input \(\mathbf{x}=(1,0)^\top\).
For this angle, \(\cos\theta=0\) and \(\sin\theta=1\), so
First rotate, then reflect. The product is
Applying it to the input gives \(\begin{bmatrix}0&-1\\-1&0\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}0\\-1\end{bmatrix}\). Checking the actions in sequence gives the same result: \(\mathbf{x}\) rotates to \((0,1)^\top\), and reflecting that vector gives \((0,-1)^\top\).
Now reflect first, then rotate:
The product sends \(\mathbf{x}\) to \(\begin{bmatrix}0&1\\1&0\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}0\\1\end{bmatrix}\). Directly, reflection leaves \((1,0)^\top\) unchanged, and the quarter-turn sends it to \((0,1)^\top\). The outputs \((0,-1)^\top\) and \((0,1)^\top\) differ, so the order matters for this input.
Worked Example: An Exact Rotation with a Non-Unit Input
Use a rotation with cosine \(\frac35\) and sine \(\frac45\), and compare the two orders on \(\mathbf{x}=(1,2)^\top\). The rotation matrix is
For rotation then reflection, first multiply the matrices:
Applying this product to the input gives
Check the sequence directly: \(\mathbf{R}\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}\frac35-\frac85\\[2pt]\frac45+\frac65\end{bmatrix}=\begin{bmatrix}-1\\2\end{bmatrix}\), and reflection sends this to \(\begin{bmatrix}-1\\-2\end{bmatrix}\).
For reflection then rotation, the product and its action are
The sequential check agrees: reflection sends \((1,2)^\top\) to \((1,-2)^\top\), and rotation sends that vector to \((\frac35+\frac85,\frac45-\frac65)^\top=(\frac{11}{5},-\frac25)^\top\). This differs from the output for the other order.
Worked Example: A Half-Turn Is an Exception
Let the rotation be a half-turn, \(\theta=\pi\), and use \(\mathbf{x}=(2,-1)^\top\). Since \(\cos\pi=-1\) and \(\sin\pi=0\),
Both products send the input to \(\begin{bmatrix}-1&0\\0&1\end{bmatrix}\begin{bmatrix}2\\-1\end{bmatrix}=\begin{bmatrix}-2\\-1\end{bmatrix}\). Check the sequential actions: rotation first gives \((-2,1)^\top\), then reflection gives \((-2,-1)^\top\). In the other order, reflection first gives \((2,1)^\top\), then rotation gives \((-2,-1)^\top\). Here the orders agree on this input, and the matrices show that they agree on every input.
Exactly When Do These Orders Agree?
The examples show that different orders can produce different outputs, but also that they need not always do so. The matrix formulas give a complete test for this particular rotation and reflection. Equality of transformations means equality of their standard matrices, so the entries can be compared directly.
Proof. Put \(c=\cos\theta\) and \(s=\sin\theta\). If \(s=0\), the two product matrices are both \(\begin{bmatrix}c&0\\0&-c\end{bmatrix}\), so they send every input to the same output. Conversely, suppose the two transformations commute. Their matrices must then be equal. Comparing the entry in row 1, column 2 gives \(-s=s\), hence \(2s=0\). Since the scalars are real, \(s=0\). Finally, when \(s\ne0\), applying the products to \(\mathbf{e}_1\) gives \(\mathbf{S}\mathbf{R}_\theta\mathbf{e}_1=(c,-s)^\top\) and \(\mathbf{R}_\theta\mathbf{S}\mathbf{e}_1=(c,s)^\top\). Their second coordinates differ because \(s\ne0\), so this input explicitly witnesses the order difference. \(\square\)
For real angles, \(\sin\theta=0\) at integer multiples of \(\pi\). Thus the two transformations agree when the rotation is by a full turn or a half-turn (including repeated turns), and they do not commute at other angles. The half-turn case is not evidence that composition order is generally irrelevant; it is a specific case covered by the condition just proved.
A Common Matrix-Order Mistake
A frequent error is to reverse the matrix factors while keeping the verbal order unchanged. For example, for “rotate, then reflect,” writing \(\mathbf{R}_{\pi/2}\mathbf{S}\) is wrong: that product applies reflection first. On \(\mathbf{e}_1\), this incorrect choice gives \(\begin{bmatrix}0&1\\1&0\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}=(0,1)^\top\), whereas the stated actions rotate \(\mathbf{e}_1\) to \((0,1)^\top\) and then reflect it to \((0,-1)^\top\). The correct matrix is \(\mathbf{S}\mathbf{R}_{\pi/2}\), and it gives \((0,-1)^\top\).
To avoid this mistake, apply the actions to a test vector in words before multiplying. The first matrix encountered by the input must represent the first transformation, so it appears on the right of the product. Then check the result in both ways: multiply the composite matrix by the input, and carry out the transformations one at a time.
Check Your Understanding
For each comparison, keep track of which action occurs first and verify outputs by applying the actions in sequence.
- Write the matrices for rotation through \(\frac{\pi}{2}\) followed by reflection across the \(x\)-axis, and for the reverse order.
- Apply both orders in question 1 to \(\mathbf{x}=(0,1)^\top\). Do the outputs agree?
- For a rotation with \(\cos\theta=\frac{5}{13}\) and \(\sin\theta=\frac{12}{13}\), find both composite matrices and apply them to \(\mathbf{e}_1\).
- Prove that if the two composite matrices are equal, then \(\sin\theta=0\).
- Explain why agreement for the half-turn does not imply that rotation and reflection commute for every angle.