From a Sequence of Actions to One Matrix
A geometric description often specifies a transformation as a sequence: rotate a vector, reflect the result, then apply a shear. To calculate the final vector efficiently, translate each action into its standard matrix and combine those matrices. The essential bookkeeping is the order: with column vectors, the matrix for the first action appears on the right of the product, because it acts first.
Here we work in \(\mathbb{R}^2\). All vectors are columns, and the rotations, reflections, projections, and shears considered are linear transformations that fix the origin. A translation, for example, is not one of these linear transformations. The standard matrix of a linear transformation \(T:\mathbb{R}^2\to\mathbb{R}^2\) is the matrix \(\mathbf{A}\) satisfying \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\) for every \(\mathbf{x}\in\mathbb{R}^2\).
Some common matrices in \(\mathbb{R}^2\) are listed below. In the rotation matrix, \(\theta\) is measured counterclockwise from the positive \(x\)-axis. The projection and reflection shown are onto and across the indicated lines through the origin. A horizontal shear adds \(k\) times the \(y\)-coordinate to the \(x\)-coordinate; a vertical shear adds \(k\) times the \(x\)-coordinate to the \(y\)-coordinate.
These matrices follow from the images of the standard basis vectors \(\mathbf{e}_1=(1,0)\) and \(\mathbf{e}_2=(0,1)\): the first column is the image of \(\mathbf{e}_1\), and the second column is the image of \(\mathbf{e}_2\). For instance, a horizontal shear sends \((x,y)\) to \((x+ky,y)\), so it sends \(\mathbf{e}_1\) to \((1,0)\) and \(\mathbf{e}_2\) to \((k,1)\). The columns give the displayed matrix.
Why the Product Has This Order
Proof. By the definition of standard matrix, \(T_1(\mathbf{x})=\mathbf{A}_1\mathbf{x}\). Applying \(T_2\) to that output gives \(T_2(T_1(\mathbf{x}))=\mathbf{A}_2(\mathbf{A}_1\mathbf{x})=(\mathbf{A}_2\mathbf{A}_1)\mathbf{x}\). Continuing one action at a time, after \(j\) actions the output is \((\mathbf{A}_j\cdots\mathbf{A}_1)\mathbf{x}\): this holds for \(j=1\), and if it holds for \(j\), applying \(T_{j+1}\) multiplies the output on the left by \(\mathbf{A}_{j+1}\), giving \((\mathbf{A}_{j+1}\mathbf{A}_j\cdots\mathbf{A}_1)\mathbf{x}\). Taking \(j=k\) proves the formula. \(\square\)
The theorem also gives a practical procedure: write the actions in the order they happen, put their matrices in reverse reading order in the product, and apply the resulting product to the input column. The matrix product itself can then be checked by applying the individual actions to the same input.
Worked Example: Rotate, Reflect, Then Shear
Rotate \(\mathbf{x}\) counterclockwise by \(90^\circ\), reflect the result across the \(x\)-axis, and then apply a horizontal shear with \(k=2\). Find the composite matrix and use it to transform \(\mathbf{x}=\begin{bmatrix}1\\2\end{bmatrix}\).
The matrices, in action order, are
The composite matrix is \(\mathbf{H}\mathbf{F}\mathbf{R}\). First multiply the two rightmost matrices:
Now multiply by \(\mathbf{H}\) on the left:
Thus the product sends the given vector to
Check by the individual actions: the rotation sends \(\begin{bmatrix}1\\2\end{bmatrix}\) to \(\begin{bmatrix}-2\\1\end{bmatrix}\). The reflection sends this to \(\begin{bmatrix}-2\\-1\end{bmatrix}\), and the horizontal shear sends that to \(\begin{bmatrix}-2+2(-1)\\-1\end{bmatrix}=\begin{bmatrix}-4\\-1\end{bmatrix}\), agreeing with the product.
Order Can Change the Result
Matrix multiplication records the order of action; it is not generally valid to rearrange the factors. This is especially visible when one action discards information, as a projection does. In the next example, both sequences use the same two transformations, but they do not have the same effect.
Worked Example: Project and Shear in Two Orders
Compare these sequences: first project onto the \(x\)-axis and then apply a vertical shear with \(k=3\); first apply the vertical shear and then project onto the \(x\)-axis. Find both composite matrices and apply them to \(\mathbf{x}=\begin{bmatrix}2\\-1\end{bmatrix}\).
Write the projection and shear matrices as
For projection followed by shear, the product is \(\mathbf{V}\mathbf{P}_x\):
Its action on the input is
Indeed, projection first gives \(\begin{bmatrix}2\\0\end{bmatrix}\), and the vertical shear then gives \(\begin{bmatrix}2\\3(2)+0\end{bmatrix}=\begin{bmatrix}2\\6\end{bmatrix}\). For shear followed by projection, the order of matrices reverses:
This product sends the input to \(\begin{bmatrix}2\\0\end{bmatrix}\). Checking directly, the shear first gives \(\begin{bmatrix}2\\3(2)+(-1)\end{bmatrix}=\begin{bmatrix}2\\5\end{bmatrix}\), and projection then gives \(\begin{bmatrix}2\\0\end{bmatrix}\). The two orders have different outputs and different matrices.
For a fixed input, two different matrices might still happen to give the same output. To say that two composites agree for every input requires their matrices to agree, as the next result shows.
Proof. If \(\mathbf{A}=\mathbf{B}\), then for every \(\mathbf{x}\), \(T(\mathbf{x})=\mathbf{A}\mathbf{x}=\mathbf{B}\mathbf{x}=U(\mathbf{x})\). Conversely, suppose \(T(\mathbf{x})=U(\mathbf{x})\) for every \(\mathbf{x}\). In particular this holds for \(\mathbf{e}_1\) and \(\mathbf{e}_2\). The first columns of \(\mathbf{A}\) and \(\mathbf{B}\) are \(T(\mathbf{e}_1)\) and \(U(\mathbf{e}_1)\), so they are equal. Their second columns are \(T(\mathbf{e}_2)\) and \(U(\mathbf{e}_2)\), so they are equal as well. Both columns agree, which gives \(\mathbf{A}=\mathbf{B}\). \(\square\)
Three Actions, One Composite Matrix
Worked Example: Rotate, Project, Then Shear
Rotate by \(180^\circ\), project onto the \(y\)-axis, and then apply a horizontal shear with \(k=1\). Find the product and transform \(\mathbf{x}=\begin{bmatrix}3\\-2\end{bmatrix}\).
The matrices are
The action order gives the product \(\mathbf{H}_1\mathbf{P}_y\mathbf{R}_{180}\). First,
Then,
Applying this matrix to the input gives
Check by the individual actions: the rotation gives \(\begin{bmatrix}-3\\2\end{bmatrix}\); the projection gives \(\begin{bmatrix}0\\2\end{bmatrix}\); and the horizontal shear gives \(\begin{bmatrix}0+2\\2\end{bmatrix}=\begin{bmatrix}2\\2\end{bmatrix}\). This agrees with the product.
A Reliable Checklist and a Common Mistake
When a problem describes a sequence of geometric actions, use the following steps:
- Write down the actions in the order they happen.
- Choose a standard matrix for each action, using the stated angle, axis, or shear factor.
- Write the matrices in reverse order in the product, with the first action at the far right.
- Multiply the matrices in manageable pairs, showing each entry of the products.
- Apply the final matrix to the input column and check the result by doing the actions one at a time.
Common mistake: multiplying in the order the actions are spoken. In the first worked example, writing \(\mathbf{R}\mathbf{F}\mathbf{H}\) instead of \(\mathbf{H}\mathbf{F}\mathbf{R}\) reverses the sequence. For the input \(\begin{bmatrix}1\\2\end{bmatrix}\), this incorrect product acts as follows: the shear gives \(\begin{bmatrix}5\\2\end{bmatrix}\), the reflection gives \(\begin{bmatrix}5\\-2\end{bmatrix}\), and the rotation gives \(\begin{bmatrix}2\\5\end{bmatrix}\). But the specified sequence gives \(\begin{bmatrix}-4\\-1\end{bmatrix}\), as checked above. The correction is to place the first action's matrix at the right, so the vector meets that matrix first.
A second useful check is dimensional: each matrix must be \(2\times2\) here, and the product must act on a \(2\times1\) input column. More importantly, verifying a product on one input confirms that calculation for that input, not necessarily for all inputs. To establish that two composites are the same transformation, compare their matrices, or compare their effects on both standard basis vectors.
Check Your Understanding
For each problem, keep the action order explicit and use a direct action-by-action check where requested.
- Reflect \(\begin{bmatrix}2\\-3\end{bmatrix}\) across the \(x\)-axis, then rotate the result counterclockwise by \(90^\circ\). Find the composite matrix and final vector.
- Project onto the \(y\)-axis, then apply a horizontal shear with \(k=2\). Find the composite matrix.
- For the sequence in question 2, calculate the output from \(\begin{bmatrix}1\\4\end{bmatrix}\) using both the composite matrix and the separate actions.
- Explain why the matrix for the first action in a sequence appears at the far right of the product.
- Give a condition, stated in terms of standard matrices, that guarantees two linear transformations on \(\mathbb{R}^2\) agree on every input.