Tutorials › Linear Algebra › Finding a Composite Transformation from Geometric Actions

Linear Transformations of R^n · Tutorial 206 of 1000

Finding a Composite Transformation from Geometric Actions

Learn to build a matrix for a sequence of geometric actions, apply it to vectors, and verify that the product follows the actions in the stated order.

Intermediate 10 min read

What You'll Learn

  • Write standard matrices for common plane rotations, reflections, projections, and shears.
  • Translate a stated sequence of actions into a product of matrices.
  • Explain why the rightmost matrix acts first on a column vector.
  • Compute a composite matrix and apply it to specified vectors.
  • Check a product by carrying out the geometric actions one at a time.
  • Identify and correct a multiplication-order error.

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\).

Definition: If actions \(T_1,T_2,\dots,T_k\) are applied in that order, the composite transformation is \(T_k\circ\cdots\circ T_2\circ T_1\). If their standard matrices are \(\mathbf{A}_1,\mathbf{A}_2,\dots,\mathbf{A}_k\), the matrix product for the composite is \(\mathbf{A}_k\cdots\mathbf{A}_2\mathbf{A}_1\).

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.

$$ \begin{aligned} \text{Rotation by }\theta:\quad &\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix} & \text{Reflection across the }x\text{-axis}:\quad &\begin{bmatrix}1&0\\0&-1\end{bmatrix}\\[4pt] \text{Projection onto the }x\text{-axis}:\quad &\begin{bmatrix}1&0\\0&0\end{bmatrix} & \text{Projection onto the }y\text{-axis}:\quad &\begin{bmatrix}0&0\\0&1\end{bmatrix}\\[4pt] \text{Horizontal shear}:\quad &\begin{bmatrix}1&k\\0&1\end{bmatrix} & \text{Vertical shear}:\quad &\begin{bmatrix}1&0\\k&1\end{bmatrix} \end{aligned} $$

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

Theorem (Matrix of a sequence of actions): Let \(T_1,\dots,T_k:\mathbb{R}^2\to\mathbb{R}^2\) be linear transformations with standard matrices \(\mathbf{A}_1,\dots,\mathbf{A}_k\). For every \(\mathbf{x}\in\mathbb{R}^2\), applying \(T_1\), then \(T_2\), and continuing through \(T_k\) gives \((T_k\circ\cdots\circ T_1)(\mathbf{x})=(\mathbf{A}_k\cdots\mathbf{A}_1)\mathbf{x}\).

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

$$ \mathbf{R}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}, \qquad \mathbf{F}=\begin{bmatrix}1&0\\0&-1\end{bmatrix}, \qquad \mathbf{H}=\begin{bmatrix}1&2\\0&1\end{bmatrix}. $$

The composite matrix is \(\mathbf{H}\mathbf{F}\mathbf{R}\). First multiply the two rightmost matrices:

$$ \mathbf{F}\mathbf{R} = \begin{bmatrix}1&0\\0&-1\end{bmatrix} \begin{bmatrix}0&-1\\1&0\end{bmatrix} = \begin{bmatrix} 1(0)+0(1)&1(-1)+0(0)\\ 0(0)+(-1)(1)&0(-1)+(-1)(0) \end{bmatrix} = \begin{bmatrix}0&-1\\-1&0\end{bmatrix}. $$

Now multiply by \(\mathbf{H}\) on the left:

$$ \mathbf{H}\mathbf{F}\mathbf{R} = \begin{bmatrix}1&2\\0&1\end{bmatrix} \begin{bmatrix}0&-1\\-1&0\end{bmatrix} = \begin{bmatrix} 1(0)+2(-1)&1(-1)+2(0)\\ 0(0)+1(-1)&0(-1)+1(0) \end{bmatrix} = \begin{bmatrix}-2&-1\\-1&0\end{bmatrix}. $$

Thus the product sends the given vector to

$$ \begin{bmatrix}-2&-1\\-1&0\end{bmatrix} \begin{bmatrix}1\\2\end{bmatrix} = \begin{bmatrix}-2(1)+(-1)(2)\\-1(1)+0(2)\end{bmatrix} = \begin{bmatrix}-4\\-1\end{bmatrix}. $$

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

$$ \mathbf{P}_x=\begin{bmatrix}1&0\\0&0\end{bmatrix}, \qquad \mathbf{V}=\begin{bmatrix}1&0\\3&1\end{bmatrix}. $$

For projection followed by shear, the product is \(\mathbf{V}\mathbf{P}_x\):

$$ \mathbf{V}\mathbf{P}_x = \begin{bmatrix}1&0\\3&1\end{bmatrix} \begin{bmatrix}1&0\\0&0\end{bmatrix} = \begin{bmatrix}1&0\\3&0\end{bmatrix}. $$

Its action on the input is

$$ \begin{bmatrix}1&0\\3&0\end{bmatrix} \begin{bmatrix}2\\-1\end{bmatrix} = \begin{bmatrix}2\\6\end{bmatrix}. $$

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:

$$ \mathbf{P}_x\mathbf{V} = \begin{bmatrix}1&0\\0&0\end{bmatrix} \begin{bmatrix}1&0\\3&1\end{bmatrix} = \begin{bmatrix}1&0\\0&0\end{bmatrix}. $$

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.

Theorem (Equality of linear transformations): Let \(T,U:\mathbb{R}^2\to\mathbb{R}^2\) have standard matrices \(\mathbf{A}\) and \(\mathbf{B}\). Then \(T(\mathbf{x})=U(\mathbf{x})\) for every \(\mathbf{x}\in\mathbb{R}^2\) if and only if \(\mathbf{A}=\mathbf{B}\).

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

$$ \mathbf{R}_{180}=\begin{bmatrix}-1&0\\0&-1\end{bmatrix}, \qquad \mathbf{P}_y=\begin{bmatrix}0&0\\0&1\end{bmatrix}, \qquad \mathbf{H}_1=\begin{bmatrix}1&1\\0&1\end{bmatrix}. $$

The action order gives the product \(\mathbf{H}_1\mathbf{P}_y\mathbf{R}_{180}\). First,

$$ \mathbf{P}_y\mathbf{R}_{180} = \begin{bmatrix}0&0\\0&1\end{bmatrix} \begin{bmatrix}-1&0\\0&-1\end{bmatrix} = \begin{bmatrix}0&0\\0&-1\end{bmatrix}. $$

Then,

$$ \mathbf{H}_1\mathbf{P}_y\mathbf{R}_{180} = \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}0&0\\0&-1\end{bmatrix} = \begin{bmatrix}0&-1\\0&-1\end{bmatrix}. $$

Applying this matrix to the input gives

$$ \begin{bmatrix}0&-1\\0&-1\end{bmatrix} \begin{bmatrix}3\\-2\end{bmatrix} = \begin{bmatrix}0(3)+(-1)(-2)\\0(3)+(-1)(-2)\end{bmatrix} = \begin{bmatrix}2\\2\end{bmatrix}. $$

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:

  1. Write down the actions in the order they happen.
  2. Choose a standard matrix for each action, using the stated angle, axis, or shear factor.
  3. Write the matrices in reverse order in the product, with the first action at the far right.
  4. Multiply the matrices in manageable pairs, showing each entry of the products.
  5. 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.

  1. 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.
  2. Project onto the \(y\)-axis, then apply a horizontal shear with \(k=2\). Find the composite matrix.
  3. 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.
  4. Explain why the matrix for the first action in a sequence appears at the far right of the product.
  5. Give a condition, stated in terms of standard matrices, that guarantees two linear transformations on \(\mathbb{R}^2\) agree on every input.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon