1.4 - Composing and reversing transformations

1.4 - Composing and reversing transformations

A sequence of transformations is represented by a matrix product, with the first transformation acting from the right. Use that order to build composite matrices, reverse a sequence, and recover an unknown transformation from its overall effect.

Transformation order

Does stretching a shape and then rotating it give the same result as rotating it and then stretching it? Track one point before multiplying any matrices.

Let S=(3001)\mathbf S=\begin{pmatrix}3&0\\0&1\end{pmatrix} be a stretch parallel to the xx-axis of factor 33, and let R=(0−110)\mathbf R=\begin{pmatrix}0&-1\\1&0\end{pmatrix} be a rotation through 90∘90^\circ anticlockwise about the origin. The stretch affects the horizontal coordinate at the moment it is applied; the rotation changes which direction that is.

Composite transformation

A composite transformation is the overall transformation obtained by applying two or more transformations in a specified order.

For an input vector r\mathbf r, applying B\mathbf B first gives Br\mathbf B\mathbf r. Applying A\mathbf A next gives A(Br)=(AB)r\mathbf A(\mathbf B\mathbf r)=(\mathbf A\mathbf B)\mathbf r.

Order in a composite matrix

First B, then A⟶AB.\text{First }\mathbf B,\text{ then }\mathbf A \quad\longrightarrow\quad \mathbf A\mathbf B.

The rightmost factor acts first. For three steps, first A\mathbf A, then B\mathbf B, then C\mathbf C gives CBA\mathbf C\mathbf B\mathbf A. Not in the formula booklet: learn it.

Read the words in time order, then build the product from the last step back towards the first.

Worked example 1: stretch, then rotate

Question. Find the matrix for the stretch S\mathbf S followed by the rotation R\mathbf R above, and find the image of P(2,1)P(2,1).

Plan. Write RS\mathbf R\mathbf S, since the stretch acts first, then multiply.

RS=(0−110)(3001)=(0−130)(RS)(21)=(−16).\begin{aligned} \mathbf R\mathbf S &=\begin{pmatrix}0&-1\\1&0\end{pmatrix} \begin{pmatrix}3&0\\0&1\end{pmatrix} =\begin{pmatrix}0&-1\\3&0\end{pmatrix}\\ (\mathbf R\mathbf S)\begin{pmatrix}2\\1\end{pmatrix} &=\begin{pmatrix}-1\\6\end{pmatrix}. \end{aligned}

Answer. The composite matrix is (0−130)\begin{pmatrix}0&-1\\3&0\end{pmatrix}, and P↦(−1,6)P\mapsto(-1,6).

Check. Apply the geometry directly: (2,1)↦(6,1)(2,1)\mapsto(6,1) under the stretch, then (6,1)↦(−1,6)(6,1)\mapsto(-1,6) under the rotation.

Change only the order. The matrices and the original point stay the same.

Worked example 2: rotate, then stretch

Question. Find the matrix for R\mathbf R followed by S\mathbf S, and find the image of P(2,1)P(2,1).

Plan. Put the stretch on the left because it now acts last.

SR=(3001)(0−110)=(0−310)(SR)(21)=(−32).\begin{aligned} \mathbf S\mathbf R &=\begin{pmatrix}3&0\\0&1\end{pmatrix} \begin{pmatrix}0&-1\\1&0\end{pmatrix} =\begin{pmatrix}0&-3\\1&0\end{pmatrix}\\ (\mathbf S\mathbf R)\begin{pmatrix}2\\1\end{pmatrix} &=\begin{pmatrix}-3\\2\end{pmatrix}. \end{aligned}

Answer. The matrix is (0−310)\begin{pmatrix}0&-3\\1&0\end{pmatrix}, and P↦(−3,2)P\mapsto(-3,2).

Check. Directly, (2,1)↦(−1,2)(2,1)\mapsto(-1,2) under the rotation, then (−1,2)↦(−3,2)(-1,2)\mapsto(-3,2) under the stretch.

The two images differ, so the opening question has answer “not in general”. Some pairs do commute, such as two rotations about the origin, but you must not assume this for an arbitrary pair.

[DIAGRAM: asset_name: The same two transformations in opposite orders; asset_slug: cam9231-transformation-order; caption: Stretching then rotating and rotating then stretching produce different images of the same triangle; description: Two exact coordinate plots compare the blue original triangle with vertices (0,0), (2,0), (2,1) and its sage image. A horizontal stretch of factor 3 followed by an anticlockwise right-angle rotation gives image vertices (0,0), (0,6), (-1,6). Reversing the order gives (0,0), (0,2), (-3,2). The point (2,1) and its two final images are labelled.]
Stretching then rotating and rotating then stretching produce different images of the same triangle

Watch out

For “B\mathbf B followed by A\mathbf A”, writing BA\mathbf B\mathbf A reverses the requested sequence. Check a point through the two separate steps if you are unsure.

Build the product from a new verbal order.

Undoing a transformation

An inverse transformation recovers each original point by undoing the last step first.

For a rotation through 90∘90^\circ anticlockwise, rotate through 90∘90^\circ clockwise to undo it. For a nonzero stretch factor, use its reciprocal along the same direction. For a shear of factor hh, use a shear of factor −h-h with the same fixed axis. A reflection is its own inverse.

You already know

If M\mathbf M is non-singular, M−1M=I\mathbf M^{-1}\mathbf M=\mathbf I. For non-singular factors, (AB)−1=B−1A−1(\mathbf A\mathbf B)^{-1}=\mathbf B^{-1}\mathbf A^{-1}. The reversed order makes the factors that cancel adjacent.

The geometry gives the same order. If M=RS\mathbf M=\mathbf R\mathbf S, the original sequence is stretch, then rotate. Its reversal is inverse rotation, then inverse stretch, represented by S−1R−1\mathbf S^{-1}\mathbf R^{-1}.

Worked example 3: reversing a composite

Question. For S=(3001)\mathbf S=\begin{pmatrix}3&0\\0&1\end{pmatrix} and R=(0−110)\mathbf R=\begin{pmatrix}0&-1\\1&0\end{pmatrix}, write (RS)−1(\mathbf R\mathbf S)^{-1} as a product of two non-identity matrices and as a single matrix. Describe the reversing sequence.

Plan. Invert both steps and reverse their time order, retaining the requested product form.

(RS)−1=S−1R−1=(13001)(01−10)=(013−10).\begin{aligned} (\mathbf R\mathbf S)^{-1} &=\mathbf S^{-1}\mathbf R^{-1}\\ &=\begin{pmatrix}\tfrac13&0\\0&1\end{pmatrix} \begin{pmatrix}0&1\\-1&0\end{pmatrix}\\ &=\begin{pmatrix}0&\tfrac13\\-1&0\end{pmatrix}. \end{aligned}

Answer. The displayed product gives the reversal: rotate through 90∘90^\circ clockwise about the origin, then stretch parallel to the xx-axis with factor 13\tfrac13.

Check. The earlier image (−1,6)(-1,6) first rotates to (6,1)(6,1), then stretches to (2,1)(2,1), the original point. Also the two-by-two inverse of (0−130)\begin{pmatrix}0&-1\\3&0\end{pmatrix}, with determinant 33, gives the same matrix.

Change only the stretch factor from 33 to 00. The collapse changes whether any reversing transformation can exist.

Worked example 4: a sequence that cannot be undone

Question. Let S0=(0001)\mathbf S_0=\begin{pmatrix}0&0\\0&1\end{pmatrix} and keep the same R\mathbf R. Determine whether RS0\mathbf R\mathbf S_0 has an inverse, explaining the geometry.

Plan. Find the composite and test whether different inputs can have the same image.

N=RS0=(0−100),(x,y)↦(−y,0).\mathbf N=\mathbf R\mathbf S_0 =\begin{pmatrix}0&-1\\0&0\end{pmatrix}, \qquad (x,y)\mapsto(-y,0).

The image depends on yy, but has lost all information about xx. For example, (1,2)(1,2) and (4,2)(4,2) both map to (−2,0)(-2,0).

Answer. No inverse exists. The zero-factor stretch collapses the plane to the yy-axis; the rotation then takes that axis to the xx-axis, without recovering the lost information.

Check. det⁡N=0\det\mathbf N=0. Algebraically, the nonzero vector (10)\begin{pmatrix}1\\0\end{pmatrix} maps to 0\mathbf0, just as the zero vector does.

A singular transformation can sometimes have a unique preimage for a specially restricted input set, but it has no inverse transformation on the whole plane. Here a proposed inverse would have to decide which of infinitely many horizontal coordinates to recover.

Exam tip

If an inverse is requested as a product, display the inverse factors in their correct order. Giving only the single multiplied-out matrix does not show that requested form.

Use geometric reversal as a check on the inverse factors.

Finding a composite matrix

An unknown step in a sequence is found by turning the time order into a matrix equation before rearranging it.

Suppose a known transformation A\mathbf A acts first, an unknown U\mathbf U acts next, and the total matrix is C\mathbf C. Then UA=C\mathbf U\mathbf A=\mathbf C, so multiply on the right by A−1\mathbf A^{-1}. If the unknown acts first instead, the equation and the side of cancellation both change.

Recovering an unknown step

For non-singular known A\mathbf A,

First A, then U:UA=C⇒U=CA−1First U, then A:AU=C⇒U=A−1C.\begin{aligned} \text{First }\mathbf A,\text{ then }\mathbf U: &\quad \mathbf U\mathbf A=\mathbf C \quad\Rightarrow\quad \mathbf U=\mathbf C\mathbf A^{-1}\\ \text{First }\mathbf U,\text{ then }\mathbf A: &\quad \mathbf A\mathbf U=\mathbf C \quad\Rightarrow\quad \mathbf U=\mathbf A^{-1}\mathbf C. \end{aligned}

The known step must be invertible for this cancellation. Not in the formula booklet: learn it.

The two formulae differ because the unknown has a different position, not because matrix multiplication has changed.

Worked example 5: recovering the last step

Question. A stretch A=(2001)\mathbf A=\begin{pmatrix}2&0\\0&1\end{pmatrix} is followed by an unknown transformation U\mathbf U. The overall matrix is C=(2101)\mathbf C=\begin{pmatrix}2&1\\0&1\end{pmatrix}. Find and describe U\mathbf U.

Plan. Write UA=C\mathbf U\mathbf A=\mathbf C and cancel the stretch on the right.

U=CA−1=(2101)(12001)=(1101).\begin{aligned} \mathbf U&=\mathbf C\mathbf A^{-1}\\ &=\begin{pmatrix}2&1\\0&1\end{pmatrix} \begin{pmatrix}\tfrac12&0\\0&1\end{pmatrix} =\begin{pmatrix}1&1\\0&1\end{pmatrix}. \end{aligned}

Its coordinate rule is X=x+y, Y=yX=x+y,\ Y=y.

Answer. U\mathbf U is a shear parallel to the xx-axis, fixing the xx-axis, of factor 11.

Check. On a general point, the two steps give

(x,y)↦(2x,y)↦(2x+y,y),(x,y)\mapsto(2x,y)\mapsto(2x+y,y),

which is precisely the rule represented by C\mathbf C.

Keep the known stretch and the overall effect unchanged, but put the unknown step first. Its matrix must change.

Worked example 6: recovering the first step

Question. An unknown transformation V\mathbf V is followed by the same stretch A\mathbf A, giving the same total matrix C\mathbf C. Find and describe V\mathbf V.

Plan. Use AV=C\mathbf A\mathbf V=\mathbf C, cancelling A\mathbf A from the left.

V=A−1C=(12001)(2101)=(11201).\begin{aligned} \mathbf V&=\mathbf A^{-1}\mathbf C\\ &=\begin{pmatrix}\tfrac12&0\\0&1\end{pmatrix} \begin{pmatrix}2&1\\0&1\end{pmatrix} =\begin{pmatrix}1&\tfrac12\\0&1\end{pmatrix}. \end{aligned}

Answer. A shear parallel to the xx-axis, fixing the xx-axis, of factor 12\tfrac12.

Check. The coordinate sequence is

(x,y)↦(x+12y,y)↦(2x+y,y).(x,y)\mapsto\left(x+\frac12y,y\right)\mapsto(2x+y,y).

It again gives C\mathbf C, whereas using the previous factor-11 shear first would give (2x+2y,y)(2x+2y,y).

For an unknown step between two known steps, the same reasoning gives BUA=C\mathbf B\mathbf U\mathbf A=\mathbf C, hence U=B−1CA−1\mathbf U=\mathbf B^{-1}\mathbf C\mathbf A^{-1}, provided both known steps are non-singular. An unfamiliar transformation needs no special name when its point-image information determines its columns.

If a known step is singular, do not use a nonexistent inverse: the available data may leave several possible unknown transformations or be inconsistent. Write the matrix equation and examine its entries instead.

Problem-solving

First write a correct equation for the entire sequence. Then put each inverse next to the factor it cancels, keeping the unknown's position visible.

The opening order question matters here: swapping steps changes both the image and the matrix needed to obtain a given image.

Quick Recap

  • In AB\mathbf A\mathbf B, B\mathbf B acts first.
  • Reverse a non-singular sequence by undoing its last step first.
  • A singular transformation loses information and has no inverse on the whole plane.
  • Recover an unknown step by writing the sequence equation and cancelling from the correct side.

Stretching then rotating need not equal rotating then stretching: the same two matrices can give different overall transformations.