Skip to main content
Logo image

Coordinated Linear Algebra

Section 6.4 Extra Topic: Geometric Transformations of the Plane

In Exploration 6.1.1, we saw how geometric shapes in the plane can be manipulated with matrix transformations. In this section we will study matrix transformations of the plane in more detail by applying transformations to pixels in photos.
We treat every pixel of a picture as a point or a vector in \(\R^2\text{.}\) A transformation is applied to each pixel, and the output pixel is colored the same color as the input pixel. The figure below shows the result of one such transformation.
Not all transformations are matrix transformations. Exercise 6.4.6.4 offers a cautionary tale on trying to find a matrix for a transformation when such a matrix does not exist. Luckily, many familiar transformations, including rotations, scalings, reflections and shears, are matrix transformations. We will focus our attention on those.
Recall that by Observation 6.1.6, we can find a matrix for each transformation by examining its action on standard basis vectors \(\mathbf{i}\) and \(\mathbf{j}\text{.}\)

Subsection 6.4.1 Horizontal and Vertical Scaling

Exploration 6.4.1.

Let us attempt to find a matrix \(M\) for the transformation \(T\) that stretches an image vertically by a factor of 2, as shown in the figure below.
Consider what this transformation does to the standard unit vectors. We observe that \(T(\mathbf{i})=\mathbf{i}\) and \(T(\mathbf{j})=2\mathbf{j}\text{.}\)
This allows us to construct a candidate for the transformation matrix \(M\text{,}\) by making the images of \(\mathbf{i}\) and \(\mathbf{j}\) the columns of \(M\text{.}\) Thus,
\begin{equation*} M=\begin{bmatrix} 1 \amp 0\\ 0 \amp 2 \end{bmatrix} \end{equation*}
We can now check to see what this matrix does to an arbitrary point \((a, b)\text{.}\) Treating this point as a vector \([a,b]\text{,}\) we compute
\begin{equation*} M=\begin{bmatrix} 1 \amp 0\\ 0 \amp 2 \end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a\\2b\end{bmatrix} \end{equation*}
Thus, this transformation takes point \((a, b)\) to point \((a, 2b)\text{.}\) So, the proposed transformation doubles all \(y\)-coordinates resulting in a vertical stretch by a factor of 2.
In general, a vertical stretch (or compression) leaves \(\mathbf{i}\) unchanged, and scales the vector \(\mathbf{j}\) while preserving its vertical direction. Thus, a vertical stretch (or compression) maps \(\mathbf{i}\) to \(\mathbf{i}\text{,}\) and maps \(\mathbf{j}\) to \(k\mathbf{j}\) for some positive number \(k\text{.}\) Similarly, a horizontal stretch (or compression) maps \(\mathbf{i}\) to \(k\mathbf{i}\text{,}\) and maps \(\mathbf{j}\) to \(\mathbf{j}\text{.}\)
In stating the above formula we stipulated that \(k\gt 0\text{.}\) If we were to allow \(k\) to be zero, what would the resulting transformations accomplish? In what way would the resulting matrices be fundamentally different from matrices \(M_v\) and \(M_h\text{?}\) What would happen if \(k\) were allowed to be negative? See Exercise 6.4.6.1.

Subsection 6.4.2 Horizontal and Vertical Shears

A horizontal shear is a transformation that takes an arbitrary point \((a, b)\) and maps it to the point \((a+kb, b)\text{.}\) The effect of this transformation is that all points along a fixed horizontal line slide to the left or to the right by a fixed amount. Note that the higher the point \((a, b)\) is above the \(x\)-axis, the greater is the magnitude of \(kb\text{,}\) resulting in a greater amount of horizontal slide.
Adding a scalar multiple of the \(y\) component to the \(x\) component can be accomplished by matrix multiplication. Observe that
\begin{equation*} \begin{bmatrix} 1 \amp k\\ 0 \amp 1 \end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a+kb\\b\end{bmatrix}. \end{equation*}
A vertical shear is a transformation that takes an arbitrary point \((a, b)\) and maps it to the point \((a, b+ka)\text{.}\) This too, can be accomplished by matrix multiplication.
\begin{equation*} \begin{bmatrix} 1 \amp 0\\ k \amp 1 \end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a\\b+ka\end{bmatrix}. \end{equation*}

Example 6.4.3.

Find the matrix \(M_{vs}\) of a matrix transformation \(T\) that shears the image of a seagull, as shown in the figure below.
Answer.
Consider what this transformation does to the standard unit vectors.
The tip of the vector \(\mathbf{i}\) slides up a vertical line and its \(x\)-component remains the same. Vector \(\mathbf{j}\) stays fixed. We observe that
\begin{equation*} T(\mathbf{i})=\begin{bmatrix} 1 \\ \tan 30^{\circ} \end{bmatrix}=\begin{bmatrix} 1 \\ \sqrt{3}/3 \end{bmatrix} \end{equation*}
and \(T(\mathbf{j})=\mathbf{j}\text{.}\) This allows us to construct \(M_{vs}\text{,}\) by making the images of \(\mathbf{i}\) and \(\mathbf{j}\) the columns of \(M_{vs}\text{.}\) Thus,
\begin{equation*} M_{vs}=\begin{bmatrix} 1 \amp 0\\ \sqrt{3}/3 \amp 1 \end{bmatrix}. \end{equation*}

Subsection 6.4.3 Rotations about the Origin

It turns out that rotations about the origin are also matrix transformations.

Example 6.4.4.

Let \(R_{45^{\circ}}:\R^2\rightarrow\R^2\) be a transformation that rotates \(\R^2\) countercolockwise about the origin by \(45^{\circ}\text{.}\) Find a matrix that induces \(R_{45^{\circ}}\text{.}\)
Answer.
Consider the action of \(R_{\theta}\) on the standard unit vectors.
We observe that
\begin{equation*} R_{\theta}(\mathbf{i})=\begin{bmatrix} \cos 45^{\circ} \\ \sin 45^{\circ} \end{bmatrix}=\begin{bmatrix} \frac{\sqrt{2}}{2} \\ \frac{\sqrt{2}}{2} \end{bmatrix} \text{ and } R_{\theta}(\mathbf{j})=\begin{bmatrix} -\sin 45^{\circ} \\ \cos 45^{\circ} \end{bmatrix}=\begin{bmatrix} -\frac{\sqrt{2}}{2} \\ \frac{\sqrt{2}}{2} \end{bmatrix}. \end{equation*}
This allows us to construct the matrix \(M_{\theta}\text{,}\) by making the images of \(\mathbf{i}\) and \(\mathbf{j}\) the columns of \(M_{\theta}\text{.}\) Thus,
\begin{equation*} M_{\theta}=\begin{bmatrix} \frac{\sqrt{2}}{2} \amp -\frac{\sqrt{2}}{2}\\ \frac{\sqrt{2}}{2} \amp \frac{\sqrt{2}}{2} \end{bmatrix}. \end{equation*}
In general, we find the rotation matrix by determining the images of the two standard vectors \(\mathbf{i}\) and \(\mathbf{j}\text{.}\)

Subsection 6.4.4 Reflections about Lines of the Form \(y=mx\)

When a point is reflected about a line, its image is located on the opposite side of the line and the same distance away from the line as the original point. This is another example of a matrix transformation.
For example, the figure below shows the reflection of point \(A\) about line \(l\text{.}\) Note that the reflection lies on a line through \(A\) perpendicular to \(l\text{.}\)
Our task is to find the matrix of a reflection of the plane about an arbitrary line through the origin.

Exploration 6.4.2.

In this problem we will find the matrix for the reflection about the \(x\) and \(y\) axes. You can easily do this on your own by finding the images of vectors \(\mathbf{i}\) and \(\mathbf{j}\text{.}\) We will start with the reflection about the \(x\)-axis.
\begin{equation*} \mathbf{i}=\begin{bmatrix}1\\0\end{bmatrix}\quad\text{maps to}\quad\begin{bmatrix}1\\0\end{bmatrix}, \end{equation*}
\begin{equation*} \mathbf{j}=\begin{bmatrix}0\\1\end{bmatrix}\quad\text{maps to}\quad\begin{bmatrix}0\\-1\end{bmatrix}. \end{equation*}
So, the matrix that induces the reflection about the \(x\)-axis is
\begin{equation*} \begin{bmatrix}1\amp 0\\0\amp -1\end{bmatrix}. \end{equation*}
Next, we will consider the reflection about the \(y\)-axis.
\begin{equation*} \mathbf{i}=\begin{bmatrix}1\\0\end{bmatrix}\quad\text{maps to}\quad\begin{bmatrix}-1\\0\end{bmatrix}, \end{equation*}
\begin{equation*} \mathbf{j}=\begin{bmatrix}0\\1\end{bmatrix}\quad\text{maps to}\quad\begin{bmatrix}0\\1\end{bmatrix}. \end{equation*}
Thus, the matrix that induces the reflection about the \(y\)-axis is
\begin{equation*} \begin{bmatrix}-1\amp 0\\0\amp 1\end{bmatrix}. \end{equation*}
Now we will turn our attention to transformations that reflect the plane about the line \(y=mx\text{.}\) We will assume that \(m\neq 0\text{.}\) Consider the vector \(\mathbf{i}\) and its reflection.
Observe that the head of the image vector, \(T(\mathbf{i})\text{,}\) will lie on the line that passes through \((1,0)\) and is perpendicular to the line \(y=mx\text{.}\) The equation of this line is given by
\begin{equation} y=-\frac{1}{m}x+\frac{1}{m}.\tag{6.4.6} \end{equation}
The head of \(T(\mathbf{i})\) will also lie on the circle with equation
\begin{equation*} x^2+y^2=1. \end{equation*}
To find the image of \(\mathbf{i}\) we need to determine where the line \(y=-\frac{1}{m}x+\frac{1}{m}\) intersects the circle. Substitution gives us
\begin{equation*} x^2+\left(-\frac{1}{m}x+\frac{1}{m}\right)^2=1. \end{equation*}
After a little algebra we get
\begin{equation*} \left(1+\frac{1}{m^2}\right)x^2-\left(\frac{2}{m^2}\right)x+\left(\frac{1}{m^2}-1\right)=0. \end{equation*}
The quadratic formula yields
\begin{equation*} x=1\quad\text{and}\quad x=\frac{1-m^2}{m^2+1}. \end{equation*}
The solution \(x=1\) corresponds to the head of the vector \(\mathbf{i}\text{.}\) So, the \(x\)-component of \(T(\mathbf{i})\) is \(x=\frac{1-m^2}{m^2+1}\text{.}\) We find the \(y\)-component of \(T(\mathbf{i})\) by substituting \(x=\frac{1-m^2}{m^2+1}\) into (6.4.6).
\begin{equation*} y=-\frac{1}{m}\left(\frac{1-m^2}{m^2+1}\right)+\frac{1}{m}=\frac{2m}{m^2+1}. \end{equation*}
Thus, the image of \(\mathbf{i}\) under this reflection is given by
\begin{equation*} T(\mathbf{i})=\begin{bmatrix}\frac{1-m^2}{m^2+1}\\\frac{2m}{m^2+1}\end{bmatrix}. \end{equation*}
Next we need to find the image of \(\mathbf{j}\text{.}\) The head of \(T(\mathbf{j})\) is located at one of the intersections of line \(y=-\frac{1}{m}x+1\) and the circle \(x^2+y^2=1\text{.}\)
We leave it to the reader to verify that
\begin{equation} \label{eq:imageofj} T(\mathbf{j})=\begin{bmatrix}\frac{2m}{m^2+1}\\\frac{m^2-1}{m^2+1}\end{bmatrix}\tag{6.4.7} \end{equation}
This reflection is induced by the matrix
\begin{equation*} M_{y=mx}=\begin{bmatrix}\frac{1-m^2}{m^2+1} \amp \frac{2m}{m^2+1}\\\frac{2m}{m^2+1} \amp \frac{m^2-1}{m^2+1}\end{bmatrix}=\frac{1}{1+m^2}\begin{bmatrix} 1-m^2 \amp 2m \\ 2m \amp m^2-1 \end{bmatrix}. \end{equation*}
Note that when \(m=0\text{,}\) expression (6.4.8) is consistent with the reflection matrix you found in Exploration 6.4.2.

Example 6.4.7.

Find matrix \(M\) that reflects the image of the duck about the line \(y=\frac{3}{5}x\text{.}\)
Answer.
\begin{align*} M \amp =\frac{1}{1+9/25}\begin{bmatrix}1-9/25 \amp 6/5\\6/5 \amp 9/25 -1\end{bmatrix} \\ \amp =\frac{25}{34}\begin{bmatrix}16/25 \amp 6/5\\6/5 \amp -16/25\end{bmatrix}=\begin{bmatrix}8/17 \amp 15/17\\15/17 \amp -8/17\end{bmatrix}. \end{align*}
Note that the eye of the duck in Example 6.4.7 is located on the line \(y=\frac{3}{5}x\text{.}\) The reflection leaves the eye fixed in place. The eye is an example of a fixed point. In Exercise 6.4.6.8 you will be asked to show that every point along the line \(y=\frac{3}{5}x\) is a fixed point.

Subsection 6.4.5 Composition of Linear Transformations

If a matrix transformation is followed by another matrix transformation, the resulting transformation can be represented as a product of the matrices that induce the individual transformations. Thus, if \(T_1\) is induced by \(M_1\) and \(T_2\) is induced by \(M_2\text{,}\) then \(T=T_2\circ T_1\) is induced by \(M=M_2M_1\text{.}\)
Remember that matrix multiplication is not commutative, so the order in which the matrices are multiplied is of utmost importance. Consider the following example which incorporates a reflection as well as a rotation of vectors.

Example 6.4.8.

  1. Find the matrix of the linear transformation which is obtained by first rotating all vectors counterclockwise by an angle of \(\pi /6\) and then reflecting across the \(x\)-axis.
  2. Multiply the vector \(\mathbf{v}=[1/2, \sqrt{3}/2]\) by the matrix you found in part (a) to illustrate how the transformation works.
Answer.
  1. Using Formula 6.4.5, the matrix of the transformation which involves rotating through an angle of \(\pi /6\) is
    \begin{equation*} M_1 = \begin{bmatrix} \cos \left( \pi /6\right) \amp -\sin \left( \pi /6\right) \\ \sin \left( \pi /6\right) \amp \cos \left( \pi /6\right) \end{bmatrix} = \begin{bmatrix} \frac{1}{2}\sqrt{3} \amp -\frac{1}{2} \\ \frac{1}{2} \amp \frac{1}{2}\sqrt{3} \end{bmatrix}. \end{equation*}
    As we learned in Exploration 6.4.2, the matrix for the transformation which reflects all vectors about the \(x\)-axis is
    \begin{equation*} M_2 = \begin{bmatrix}1 \amp 0 \\ 0 \amp -1 \end{bmatrix}. \end{equation*}
    Therefore, the matrix of the linear transformation which first rotates through \(\pi /6\) and then reflects through the \(x\)-axis is given by
    \begin{equation*} M = M_2 M_1 = \begin{bmatrix}1 \amp 0 \\ 0 \amp -1 \end{bmatrix} \begin{bmatrix} \frac{1}{2}\sqrt{3} \amp -\frac{1}{2} \\ \frac{1}{2} \amp \frac{1}{2}\sqrt{3} \end{bmatrix} = \begin{bmatrix} \frac{1}{2}\sqrt{3} \amp \frac{1}{2} \\ -\frac{1}{2} \amp -\frac{1}{2}\sqrt{3} \end{bmatrix}. \end{equation*}
  2. From unit circle trigonometry, we know that \(\mathbf{v}\) makes a \(\pi/3\) angle with the \(x\)-axis. If we rotate \(\mathbf{v}\) counterclockwise by \(\pi /6\text{,}\) it will point straight up.
    Following the rotation with reflection across the \(x\)-axis will make it point straight down. Sure enough,
    \begin{equation*} M\mathbf{v} = \begin{bmatrix} \frac{1}{2}\sqrt{3} \amp -\frac{1}{2} \\ -\frac{1}{2} \amp -\frac{1}{2}\sqrt{3} \end{bmatrix} \begin{bmatrix} 1/2 \\ \sqrt{3}/2 \end{bmatrix} = \begin{bmatrix} 0 \\ -1 \end{bmatrix}. \end{equation*}

Exploration 6.4.3.

You can use the GeoGebra interactive below to decompose a matrix into a product of two matrices corresponding to the basic transformations we discussed above: scalings, rotations, shears and reflections.
Figure 6.4.9.
Problem 6.4.10.
Consider the matrix
\begin{equation*} M=\begin{bmatrix} 1 \amp 0\\-1 \amp -1\end{bmatrix}. \end{equation*}
This matrix induces a transformation that can be broken into two parts: (1) a reflection followed by (2) a shear. Find matrices \(M_1\) and \(M_2\) that induce the reflection and the shear respectively. Verify that the product of the two matrices is equal to \(M\) (be careful about the order of the product!).
Answer.
\begin{equation*} M=M_2M_1=\begin{bmatrix}1\amp 0\\-1\amp 1\end{bmatrix}\begin{bmatrix}1\amp 0\\0\amp -1\end{bmatrix}. \end{equation*}
Problem 6.4.11.
Let
\begin{equation*} M=\begin{bmatrix}-1\amp 0\\0\amp -1\end{bmatrix}. \end{equation*}
Use the GeoGebra interactive above to visually examine the transformation induced by \(M\text{.}\) The composition of which transformation is equivalent to the transformation induced by \(M\text{?}\)
  1. Rotation by 180 degrees.
  2. Reflection about the \(x\)-axis, followed by a reflection about the \(y\)-axis.
  3. Reflection about the \(y\)-axis, followed by a reflection about the \(x\)-axis.
  4. All of the above.
Answer.
Option (d).
Problem 6.4.12.
Let
\begin{equation*} M=\begin{bmatrix}0\amp 1\\-1\amp 0\end{bmatrix}. \end{equation*}
Use the GeoGebra interactive above to visually examine the transformation induced by \(M\text{.}\) The composition of which transformations is equivalent to the transformation induced by \(M\text{?}\)
  1. Reflection about the \(x\)-axis, followed by a reflection about the line \(y=-x\text{.}\)
  2. Reflection about the \(y\)-axis, followed by a reflection about the \(x\)-axis.
  3. All of the above.
  4. None of the above.
Answer.
Option (a).

Example 6.4.13.

In this problem we will consider compositions of two reflections and use geometry to illustrate non-commutativity of matrix multiplication. Let
\begin{equation*} T_{y=-2x}:\R^2\rightarrow \R^2 \end{equation*}
be a reflection about the line \(y=-2x\text{.}\) Let
\begin{equation*} T_{y=x}:\R^2\rightarrow \R^2 \end{equation*}
be a reflection about the line \(y=x\text{.}\) We will denote the standard matrices for these transformations by \(M_{y=-2x}\) and \(M_{y=x}\text{,}\) and use geometry to demonstrate that \(M_{y=x}M_{y=-2x}\neq M_{y=-2x}M_{y=x}\text{.}\)
To do this, consider transformations
\begin{equation*} T_1=T_{y=x}\circ T_{y=-2x} \text{ and } T_2=T_{y=-2x}\circ T_{y=x}. \end{equation*}
Transformation \(T_1\) is induced by \(M_{y=x}M_{y=-2x}\text{,}\) and \(T_2\) is induced by \(M_{y=-2x}M_{y=x}\text{.}\)
The figure on the left illustrates the action of \(T_1\) on a single point \(A\text{.}\) First, \(A\) is reflected about the line \(y=-2x\text{,}\) then \(A\) is reflected about the line \(y=x\text{.}\)
The figure on the right shows the action of \(T_2\) on the same point \(A\text{.}\) The point is first reflected about the line \(y=x\text{,}\) followed by a reflection about the line \(y=-2x\text{.}\) The final images of point \(A\) under \(T_1\) and \(T_2\) are clearly different.
Since \(T_1\neq T_2\text{,}\) we conclude that \(M_{y=x}M_{y=-2x}\neq M_{y=-2x}M_{y=x}\text{.}\)

Example 6.4.14.

Some pairs of matrices do commute. For example, geometry makes it is easy to see that two rotation matrices commute.

Exercises 6.4.6 Exercises

1.

Consider matrices \(M_v\) and \(M_h\) in (6.4.1) and (6.4.2).
  1. If we were to allow \(k\) to be zero, what would the resulting transformations accomplish?
  2. If \(k=0\text{,}\) in what way would the resulting matrices be fundamentally different from matrices \(M_v\) and \(M_h\) \((k\neq 0)\text{?}\)
  3. Do \(M_v\) and \(M_h\) \((k\neq 0)\) have inverses? What about \(M_v\) and \(M_h\) \((k= 0)\text{?}\)
  4. What would happen if we allowed \(k\) to be negative?

2.

Find a matrix \(M\) that would double the length of a photo horizontally, and triple the height of the photo.
\begin{equation*} M=\begin{bmatrix}2 \amp 0\\0 \amp 3\end{bmatrix}. \end{equation*}

3.

(Sheared Sheep) Find a matrix that induces the transformation shown in the figure.
Sheep

4.

Suppose a 1 by 1 photo of a chipmunk was shifted as shown in the figure.
Suppose we tried to construct a standard matrix \(M\) for this transformation by making the images of \(\mathbf{i}\) and \(\mathbf{j}\) the columns of \(M\text{.}\) We would obtain
\begin{equation*} M=\begin{bmatrix}1.4 \amp 0.4\\0.4 \amp 1.4\end{bmatrix} \end{equation*}
Does this matrix describe the transformation? If so, prove it. If not, explain why not.

5.

A transformation \(T:\R^2\rightarrow \R^2\) that shifts all points in the plane horizontally or vertically by a fixed amount is called a translation. Is \(T\) a matrix transformation? Prove your claim.

6.

A reflection about the line \(y=mx\) followed by another reflection about the same line, returns all points to their original position. Prove this using matrix multiplication.
Hint.
Find the product of \(M_{y=mx}M_{y=mx}\text{.}\)

8.

Prove that every point along the line \(y=\frac{3}{5}x\) in Example 6.4.7 is a fixed point.

9.

The figure below shows a sequence of two matrix transformations that accomplishes a reflection about the line \(y=\frac{3}{5}x\text{.}\) The first transformation is a reflection of the plane about the \(x\)-axis. The second transformation is a rotation of the plane about the origin. Find matrices that induce the two transformations and verify that their product (in the correct order) is the reflection matrix of Example 6.4.7.