# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/geometric-transformation/composite-transformation-matrix
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/geometric-transformation/composite-transformation-matrix/en.mdx

Learn composite transformation matrices with worked examples. Combine reflections, rotations, and dilations using matrix multiplication.

---

## Composition of Transformations Using Matrices

In geometry, a transformation is an operation that moves or changes the shape of an object. When multiple transformations are applied sequentially to an object, this is called a composition of transformations.

We can use matrices to represent many geometric transformations and also to find the result of the composition of these transformations.

We will focus on transformations that can be represented by $$2 \times 2$$ matrices. For example, reflection across the $$x$$-axis can be represented by the matrix $$\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$. If the point $$(x,y)$$ is reflected across the $$x$$-axis, its image can be found by multiplying this matrix by the position vector of the point: $$\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}$$.

Visible text: We will focus on transformations that can be represented by matrices. For example, reflection across the -axis can be represented by the matrix . If the point is reflected across the -axis, its image can be found by multiplying this matrix by the position vector of the point: .

Here are some basic transformations along with their matrices that are often used in the composition of transformations:

1.  Reflection across the $$x$$-axis: $$\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$
2.  Reflection across the $$y$$-axis: $$\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$$
3.  Reflection across the line $$y=x$$: $$\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
4.  Reflection across the line $$y=-x$$: $$\begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}$$
5.  Reflection across the origin $$O(0,0)$$ (equivalent to a $$180^\circ$$ rotation): $$\begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}$$
6.  Rotation about the origin $$(0,0)$$ by an angle $$\theta$$: $$\begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix}$$
7.  Dilation about the origin $$(0,0)$$ with a scale factor $$k$$: $$\begin{pmatrix} k & 0 \\ 0 & k \end{pmatrix}$$

Visible text: 1. Reflection across the -axis: 
2. Reflection across the -axis: 
3. Reflection across the line : 
4. Reflection across the line : 
5. Reflection across the origin (equivalent to a rotation): 
6. Rotation about the origin by an angle : 
7. Dilation about the origin with a scale factor :

### Operating Composition of Transformations Using Matrices

Composition of transformations means performing several transformations in sequence. If transformation $$T_1$$ is followed by transformation $$T_2$$, we denote it as $$T_2 \circ T_1$$. This means $$T_1$$ is applied first, then its result is transformed by $$T_2$$.

Visible text: Composition of transformations means performing several transformations in sequence. If transformation is followed by transformation , we denote it as . This means is applied first, then its result is transformed by .

Suppose the matrix corresponding to $$T_1$$ is $$M_1$$, and the matrix corresponding to $$T_2$$ is $$M_2$$. To find the image of point $$P(x,y)$$ under the composition $$T_2 \circ T_1$$, there are two equivalent methods:

Visible text: Suppose the matrix corresponding to is , and the matrix corresponding to is . To find the image of point under the composition , there are two equivalent methods:

1.  **Applying Transformations Sequentially to the Point:**

    - Calculate the image <InlineMath math="P'(x',y')" /> of $$P(x,y)$$ under $$T_1$$: <InlineMath math="\begin{pmatrix} x' \\ y' \end{pmatrix} = M_1 \begin{pmatrix} x \\ y \end{pmatrix}" />.
    - Then, calculate the image <InlineMath math="P''(x'',y'')" /> of <InlineMath math="P'(x',y')" /> under $$T_2$$: <InlineMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M_2 \begin{pmatrix} x' \\ y' \end{pmatrix}" />.

    If we substitute step (a) into (b), we get: <InlineMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M_2 \left( M_1 \begin{pmatrix} x \\ y \end{pmatrix} \right)" />.

2.  **Finding the Composite Matrix First:**

    - Determine the matrix $$M$$ that represents the composite transformation $$T_2 \circ T_1$$. This matrix is the product $$M_2 M_1$$.

      **Note the order:** the matrix of the second transformation ($$M_2$$) is multiplied from the left by the matrix of the first transformation ($$M_1$$).

    - Calculate the image <InlineMath math="P''(x'',y'')" /> of $$P(x,y)$$ using the composite matrix $$M$$: <InlineMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M \begin{pmatrix} x \\ y \end{pmatrix} = (M_2 M_1) \begin{pmatrix} x \\ y \end{pmatrix}" />.

Visible text: 1. **Applying Transformations Sequentially to the Point:**

 - Calculate the image <InlineMath math="P'(x',y')" /> of under : <InlineMath math="\begin{pmatrix} x' \\ y' \end{pmatrix} = M_1 \begin{pmatrix} x \\ y \end{pmatrix}" />.
 - Then, calculate the image <InlineMath math="P''(x'',y'')" /> of <InlineMath math="P'(x',y')" /> under : <InlineMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M_2 \begin{pmatrix} x' \\ y' \end{pmatrix}" />.

 If we substitute step (a) into (b), we get: <InlineMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M_2 \left( M_1 \begin{pmatrix} x \\ y \end{pmatrix} \right)" />.

2. **Finding the Composite Matrix First:**

 - Determine the matrix that represents the composite transformation . This matrix is the product .

 **Note the order:** the matrix of the second transformation () is multiplied from the left by the matrix of the first transformation ().

 - Calculate the image <InlineMath math="P''(x'',y'')" /> of using the composite matrix : <InlineMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M \begin{pmatrix} x \\ y \end{pmatrix} = (M_2 M_1) \begin{pmatrix} x \\ y \end{pmatrix}" />.

Both methods yield the same final image due to the associative property of matrix multiplication, i.e., $$M_2 (M_1 P) = (M_2 M_1) P$$, where $$P$$ is the column vector $$\begin{pmatrix} x \\ y \end{pmatrix}$$.

Visible text: Both methods yield the same final image due to the associative property of matrix multiplication, i.e., , where is the column vector .

**Illustrative Example:**

Suppose $$T_1$$ is a reflection across the $$y$$-axis, and $$T_2$$ is a rotation about the origin $$O$$ by $$\frac{1}{2}\pi$$ radians ($$90^\circ$$). We want to find the image of point $$P(x,y)$$ under $$T_2 \circ T_1$$.

Visible text: Suppose is a reflection across the -axis, and is a rotation about the origin by radians (). We want to find the image of point under .

The matrix for $$T_1$$ (reflection across the $$y$$-axis) is $$M_1 = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$$.

Visible text: The matrix for (reflection across the -axis) is .

The matrix for $$T_2$$ (rotation $$90^\circ$$) is $$M_2 = \begin{pmatrix} \cos 90^\circ & -\sin 90^\circ \\ \sin 90^\circ & \cos 90^\circ \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$.

Visible text: The matrix for (rotation ) is .

**Method $$1$$: Sequential Transformation on the Point**

Visible text: **Method : Sequential Transformation on the Point**

- Image of $$P(x,y)$$ under $$T_1$$:

  <BlockMath math="\begin{pmatrix} x' \\ y' \end{pmatrix} = M_1 \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -x \\ y \end{pmatrix}" />

  So <InlineMath math="P'(-x,y)" />.

- Image of <InlineMath math="P'(-x,y)" /> under $$T_2$$:

  <BlockMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M_2 \begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} -x \\ y \end{pmatrix} = \begin{pmatrix} (0)(-x)+(-1)(y) \\ (1)(-x)+(0)(y) \end{pmatrix} = \begin{pmatrix} -y \\ -x \end{pmatrix}" />

- The final image is <InlineMath math="P''(-y,-x)" />.

Visible text: - Image of under :

 <BlockMath math="\begin{pmatrix} x' \\ y' \end{pmatrix} = M_1 \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -x \\ y \end{pmatrix}" />

 So <InlineMath math="P'(-x,y)" />.

- Image of <InlineMath math="P'(-x,y)" /> under :

 <BlockMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M_2 \begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} -x \\ y \end{pmatrix} = \begin{pmatrix} (0)(-x)+(-1)(y) \\ (1)(-x)+(0)(y) \end{pmatrix} = \begin{pmatrix} -y \\ -x \end{pmatrix}" />

- The final image is <InlineMath math="P''(-y,-x)" />.

**Method $$2$$: Composite Matrix First**

Visible text: **Method : Composite Matrix First**

- Composite matrix $$M = M_2 M_1$$:

  
  
  ```math
  M = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} (0)(-1)+(-1)(0) & (0)(0)+(-1)(1) \\ (1)(-1)+(0)(0) & (1)(0)+(0)(1) \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}
  ```

- Image of $$P(x,y)$$ under $$M$$:

  <BlockMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} (0)(x)+(-1)(y) \\ (-1)(x)+(0)(y) \end{pmatrix} = \begin{pmatrix} -y \\ -x \end{pmatrix}" />

- The final image is <InlineMath math="P''(-y,-x)" />.

Visible text: - Composite matrix :

 
 

- Image of under :

 <BlockMath math="\begin{pmatrix} x'' \\ y'' \end{pmatrix} = M \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} (0)(x)+(-1)(y) \\ (-1)(x)+(0)(y) \end{pmatrix} = \begin{pmatrix} -y \\ -x \end{pmatrix}" />

- The final image is <InlineMath math="P''(-y,-x)" />.

Both methods give the same result. Using the composite matrix ($$M_2 M_1$$) is often more efficient if we need to transform many points with the same composition.

Visible text: Both methods give the same result. Using the composite matrix () is often more efficient if we need to transform many points with the same composition.

## Composite Matrix Rule

Suppose the matrices related to transformations $$T_1$$ and $$T_2$$ are $$M_1 = \begin{pmatrix} p & q \\ r & s \end{pmatrix}$$ and $$M_2 = \begin{pmatrix} t & u \\ v & w \end{pmatrix}$$ respectively.

Visible text: Suppose the matrices related to transformations and are and respectively.

Then, the matrix related to the composition of transformations $$T_2 \circ T_1$$ (Transformation $$T_1$$ followed by $$T_2$$) is $$M_2 M_1 = \begin{pmatrix} t & u \\ v & w \end{pmatrix} \begin{pmatrix} p & q \\ r & s \end{pmatrix}$$.

Visible text: Then, the matrix related to the composition of transformations (Transformation followed by ) is .

Remember that the order of matrix multiplication is important. The matrix for the transformation performed first ($$M_1$$) is written on the right.

Visible text: Remember that the order of matrix multiplication is important. The matrix for the transformation performed first () is written on the right.

## Application Examples

### Composition of Two Reflections

Determine the image of the point $$(2,5)$$ reflected across the $$x$$-axis and then reflected across the $$y$$-axis.

Visible text: Determine the image of the point reflected across the -axis and then reflected across the -axis.

**Alternative Solution:**

Let $$T_1$$ be the reflection across the $$x$$-axis, and $$T_2$$ be the reflection across the $$y$$-axis.

Visible text: Let be the reflection across the -axis, and be the reflection across the -axis.

The matrix for $$T_1$$ ($$M_1$$) is $$\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$.

Visible text: The matrix for () is .

The matrix for $$T_2$$ ($$M_2$$) is $$\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$$.

Visible text: The matrix for () is .

The composition of transformations $$T_2 \circ T_1$$ has the matrix $$M = M_2 M_1$$.

Visible text: The composition of transformations has the matrix .

```math
M = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} (-1)(1)+(0)(0) & (-1)(0)+(0)(-1) \\ (0)(1)+(1)(0) & (0)(0)+(1)(-1) \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}
```

The image of the point $$(2,5)$$ is:

Visible text: The image of the point is:

```math
\begin{pmatrix} x' \\ y' \end{pmatrix} = M \begin{pmatrix} 2 \\ 5 \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} 2 \\ 5 \end{pmatrix} = \begin{pmatrix} (-1)(2)+(0)(5) \\ (0)(2)+(-1)(5) \end{pmatrix} = \begin{pmatrix} -2 \\ -5 \end{pmatrix}
```

So, the image of the point is $$(-2,-5)$$.

Visible text: So, the image of the point is .

### Composition of Reflection and Rotation

Determine the image of the point $$(-2,3)$$ transformed by the composition of a reflection across the $$y$$-axis followed by a $$180^\circ$$ rotation about the origin.

Visible text: Determine the image of the point transformed by the composition of a reflection across the -axis followed by a rotation about the origin.

**Alternative Solution:**

Let $$T_1$$ be the reflection across the $$y$$-axis, and $$T_2$$ be the $$180^\circ$$ rotation about the origin.

Visible text: Let be the reflection across the -axis, and be the rotation about the origin.

The matrix for $$T_1$$ ($$M_1$$) is $$\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$$.

Visible text: The matrix for () is .

The matrix for $$T_2$$ ($$M_2$$) is $$\begin{pmatrix} \cos 180^\circ & -\sin 180^\circ \\ \sin 180^\circ & \cos 180^\circ \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}$$.

Visible text: The matrix for () is .

The composition of transformations $$T_2 \circ T_1$$ has the matrix $$M = M_2 M_1$$.

Visible text: The composition of transformations has the matrix .

```math
M = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} (-1)(-1)+(0)(0) & (-1)(0)+(0)(1) \\ (0)(-1)+(-1)(0) & (0)(0)+(-1)(1) \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
```

The image of the point $$(-2,3)$$ is:

Visible text: The image of the point is:

```math
\begin{pmatrix} x' \\ y' \end{pmatrix} = M \begin{pmatrix} -2 \\ 3 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} -2 \\ 3 \end{pmatrix} = \begin{pmatrix} (1)(-2)+(0)(3) \\ (0)(-2)+(-1)(3) \end{pmatrix} = \begin{pmatrix} -2 \\ -3 \end{pmatrix}
```

So, the image of the point is $$(-2,-3)$$.

Visible text: So, the image of the point is .

### Composition of Three Transformations

Suppose you want to perform three transformations on a point $$P(2,5)$$, namely reflection across the $$x$$-axis, rotation $$90^\circ$$ about the origin, and a half turn ($$180^\circ$$ rotation about the origin). Determine its image!

Visible text: Suppose you want to perform three transformations on a point , namely reflection across the -axis, rotation about the origin, and a half turn ( rotation about the origin). Determine its image!

**Alternative Solution:**

Let:

- $$T_1$$: Reflection across the $$x$$-axis.

  Matrix $$M_1 = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$

- $$T_2$$: Rotation $$90^\circ$$ about the
  origin.

  Matrix $$M_2 = \begin{pmatrix} \cos 90^\circ & -\sin 90^\circ \\ \sin 90^\circ & \cos 90^\circ \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$

- $$T_3$$: Half turn ($$180^\circ$$ rotation
  about the origin).

  Matrix $$M_3 = \begin{pmatrix} \cos 180^\circ & -\sin 180^\circ \\ \sin 180^\circ & \cos 180^\circ \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}$$

Visible text: - : Reflection across the -axis.

 Matrix 

- : Rotation about the
 origin.

 Matrix 

- : Half turn ( rotation
 about the origin).

 Matrix

The composition of transformations is $$T_3 \circ T_2 \circ T_1$$. Its matrix is $$M = M_3 M_2 M_1$$.

Visible text: The composition of transformations is . Its matrix is .

Component: MathContainer
Children:

```math
M_2 M_1 = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} (0)(1)+(-1)(0) & (0)(0)+(-1)(-1) \\ (1)(1)+(0)(0) & (1)(0)+(0)(-1) \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
```

```math
M = M_3 (M_2 M_1) = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} (-1)(0)+(0)(1) & (-1)(1)+(0)(0) \\ (0)(0)+(-1)(1) & (0)(1)+(-1)(0) \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}
```

The image of $$P(2,5)$$ is:

Visible text: The image of is:

```math
\begin{pmatrix} x' \\ y' \end{pmatrix} = M \begin{pmatrix} 2 \\ 5 \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix} \begin{pmatrix} 2 \\ 5 \end{pmatrix} = \begin{pmatrix} (0)(2)+(-1)(5) \\ (-1)(2)+(0)(5) \end{pmatrix} = \begin{pmatrix} -5 \\ -2 \end{pmatrix}
```

So, the image of the point is $$(-5,-2)$$.

Visible text: So, the image of the point is .

## Exercise

Suppose we want to perform three transformations on a point $$P(2,5)$$, namely reflection across the $$y$$-axis, rotation $$180^\circ$$ about the origin, and reflection across the line $$y=x$$. Determine its image!

Visible text: Suppose we want to perform three transformations on a point , namely reflection across the -axis, rotation about the origin, and reflection across the line . Determine its image!

### Answer Key

Let:

- $$T_1$$: Reflection across the $$y$$-axis.

  Matrix $$M_1 = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$$.

- $$T_2$$: Rotation $$180^\circ$$ about the
  origin.

  Matrix $$M_2 = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}$$.

- $$T_3$$: Reflection across the line $$y=x$$
  .

  Matrix $$M_3 = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$

Visible text: - : Reflection across the -axis.

 Matrix .

- : Rotation about the
 origin.

 Matrix .

- : Reflection across the line 
 .

 Matrix

The composition of transformations is $$T_3 \circ T_2 \circ T_1$$. Its matrix is $$M = M_3 M_2 M_1$$.

Visible text: The composition of transformations is . Its matrix is .

**Step** $$1$$: Calculate $$M_2 M_1$$.

Visible text: **Step** : Calculate .

```math
M_2 M_1 = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} (-1)(-1)+(0)(0) & (-1)(0)+(0)(1) \\ (0)(-1)+(-1)(0) & (0)(0)+(-1)(1) \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
```

**Step** $$2$$: Calculate $$M = M_3 (M_2 M_1)$$.

Visible text: **Step** : Calculate .

```math
M = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} (0)(1)+(1)(0) & (0)(0)+(1)(-1) \\ (1)(1)+(0)(0) & (1)(0)+(0)(-1) \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}
```

The image of $$P(2,5)$$ is:

Visible text: The image of is:

```math
\begin{pmatrix} x' \\ y' \end{pmatrix} = M \begin{pmatrix} 2 \\ 5 \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 2 \\ 5 \end{pmatrix} = \begin{pmatrix} (0)(2)+(-1)(5) \\ (1)(2)+(0)(5) \end{pmatrix} = \begin{pmatrix} -5 \\ 2 \end{pmatrix}
```

So, the image of the point is $$(-5,2)$$.

Visible text: So, the image of the point is .