Geometric Transformations of the Plane

In Exploration exp:shapeTransformation 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 matrix transformations to pixels in photos. We will treat every pixel of a picture as a point or the head of a vector in \(\RR ^2\). When a transformation is applied to each pixel, 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. Practice Problem prob:translation_does_not_work offers a cautionary tale of what happens when we try 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 obs:imagesOfijk of Matrix Transformations, we can find a matrix of a matrix transformation by examining what the transformation does to the standard basis vectors \(\vec {i}\) and \(\vec {j}\).

Horizontal and Vertical Scaling

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(\vec {i})=\vec {i}\) and \(T(\vec {j})=2\vec {j}\).

[Picture] [Picture]

This allows us to construct a candidate for the transformation matrix \(M\), by making the images of \(\vec {i}\) and \(\vec {j}\) the columns of \(M\). Thus,

\[M=\begin{bmatrix} 1 & 0\\ 0 & 2 \end{bmatrix}\]

We can now check to see what this matrix does to an arbitrary point \((a, b)\). Treating this point as a vector \(\begin{bmatrix}a\\b\end{bmatrix}\), we compute

\[M=\begin{bmatrix} 1 & 0\\ 0 & 2 \end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a\\2b\end{bmatrix}\]
Thus, this transformation takes point \((a, b)\) to point \((a, 2b)\). 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 \(\vec {i}\) unchanged, and scales the vector \(\vec {j}\) while preserving its vertical direction. Thus, a vertical stretch (or compression) maps \(\vec {i}\) to \(\vec {i}\), and maps \(\vec {j}\) to \(k\vec {j}\) for some positive number \(k\). Similarly, a horizontal stretch (or compression) maps \(\vec {i}\) to \(k\vec {i}\), and maps \(\vec {j}\) to \(\vec {j}\).

In stating the above formula we stipulated that \(k>0\). 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\)? What would happen if \(k\) were allowed to be negative? (See Practice Problem )

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)\). 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\), resulting in a greater amount of horizontal slide.

[Picture] [Picture]

Adding a scalar multiple of the \(y\) component to the \(x\) component can be accomplished by matrix multiplication. Observe that

\[\begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a+kb\\b\end{bmatrix}\]

A vertical shear is a transformation that takes an arbitrary point \((a, b)\) and maps it to the point \((a, b+ka)\). This too, can be accomplished by matrix multiplication.

\[\begin{bmatrix} 1 & 0\\ k & 1 \end{bmatrix}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a\\b+ka\end{bmatrix}\]

Rotations about the Origin

It turns out that rotations about the origin are also matrix transformations. You will have an opportunity to revisit and prove this claim in Challenge Problems for Chapter 6.

In general, we find the rotation matrix by determining the images of vectors \(\vec {i}\) and \(\vec {j}\).

[Picture] [Picture]

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. (We will prove that this is a matrix transformation in Challenge Problems for Chapter 6.)

For example, the figure below shows the reflection of point \(A\) about line \(l\). Note that the reflection lies on a line through \(A\) perpendicular to \(l\).

[Picture]

Our task is to find the matrix of a reflection of the plane about an arbitrary line through the origin.

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 \(\vec {i}\) and \(\vec {j}\).

We will start with the reflection about the \(x\)-axis.

\[\vec {i}=\begin{bmatrix}1\\0\end{bmatrix}\quad \text {maps to}\quad \begin{bmatrix}\answer {1}\\\answer {0}\end{bmatrix}\]
\[\vec {j}=\begin{bmatrix}0\\1\end{bmatrix}\quad \text {maps to}\quad \begin{bmatrix}\answer {0}\\\answer {-1}\end{bmatrix}\]

So, the matrix that induces the reflection about the \(x\)-axis is

\[\begin{bmatrix}\answer {1}&\answer {0}\\\answer {0}&\answer {-1}\end{bmatrix}\]
Next, we will consider the reflection about the \(y\)-axis.
\[\vec {i}=\begin{bmatrix}1\\0\end{bmatrix}\quad \text {maps to}\quad \begin{bmatrix}\answer {-1}\\\answer {0}\end{bmatrix}\]
\[\vec {j}=\begin{bmatrix}0\\1\end{bmatrix}\quad \text {maps to}\quad \begin{bmatrix}\answer {0}\\\answer {1}\end{bmatrix}\]

Thus, the matrix that induces the reflection about the \(y\)-axis is

\[\begin{bmatrix}\answer {-1}&\answer {0}\\\answer {0}&\answer {1}\end{bmatrix}\]

Now we will turn our attention to transformations that reflect the plane about the line \(y=mx\). We will assume that \(m\neq 0\).

Consider the vector \(\vec {i}\) and its reflection.

[Picture]

Observe that the head of the image vector, \(T(\vec {i})\), will lie on the line that passes through \((1,0)\) and is perpendicular to the line \(y=mx\). The equation of this line is given by

\begin{equation}\label {eq:reflectionline} y=-\frac {1}{m}x+\frac {1}{m} \end{equation}

The head of \(T(\vec {i})\) will also lie on the circle with equation

\[x^2+y^2=1\]

To find the image of \(\vec {i}\) we need to determine where the line \(y=-\frac {1}{m}x+\frac {1}{m}\) intersects the circle. Substitution gives us

\[x^2+\left (-\frac {1}{m}x+\frac {1}{m}\right )^2=1\]

After a little algebra we get

\[\left (1+\frac {1}{m^2}\right )x^2-\left (\frac {2}{m^2}\right )x+\left (\frac {1}{m^2}-1\right )=0\]

The quadratic formula yields

\[x=1\quad \text {and}\quad x=\frac {1-m^2}{m^2+1}\]

The solution \(x=1\) corresponds to the head of the vector \(\vec {i}\). So, the \(x\)-component of \(T(\vec {i})\) is \(x=\frac {1-m^2}{m^2+1}\). We find the \(y\)-component of \(T(\vec {i})\) by substituting \(x=\frac {1-m^2}{m^2+1}\) into Equation 6.

\[ y=-\frac {1}{m}\left (\frac {1-m^2}{m^2+1}\right )+\frac {1}{m}=\frac {2m}{m^2+1}\]

Thus, the image of \(\vec {i}\) under this reflection is given by

\[T(\vec {i})=\begin{bmatrix}\frac {1-m^2}{m^2+1}\\\frac {2m}{m^2+1}\end{bmatrix}\]

Next we need to find the image of \(\vec {j}\). The head of \(T(\vec {j})\) is located at one of the intersections of line \(y=-\frac {1}{m}x+1\) and the circle \(x^2+y^2=1\).

[Picture]

We leave it to the reader to verify that

\begin{equation}\label {eq:imageofj} T(\vec {j})=\begin{bmatrix}\frac {2m}{m^2+1}\\\frac {m^2-1}{m^2+1}\end{bmatrix}\end{equation}

This reflection is induced by the matrix

\[M_{y=mx}=\begin{bmatrix}\frac {1-m^2}{m^2+1} & \frac {2m}{m^2+1}\\\frac {2m}{m^2+1} & \frac {m^2-1}{m^2+1}\end{bmatrix}=\frac {1}{1+m^2}\begin{bmatrix} 1-m^2 & 2m \\ 2m & m^2-1 \end{bmatrix}\]

Note that when \(m=0\), expression (8) is consistent with the reflection matrix you found in Exploration .

Note that the eye of the duck in Example 9 is located on the line \(y=\frac {3}{5}x\). The reflection leaves the eye fixed in place. The eye is an example of a fixed point. In Practice Problem you will be asked to show that every point along the line \(y=\frac {3}{5}x\) is a fixed point.

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 two matrices that induce the individual transformations. Thus, if \(T_1\) is induced by \(M_1\) and \(T_2\) is induced by \(M_2\), then \(T=T_2\circ T_1\) is induced by \(M=M_2M_1\).

[Picture]

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.

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.

Consider the matrix \(M=\begin{bmatrix} 1 & 0\\-1 & -1\end{bmatrix}\). 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!).

\[M=M_2M_1=\begin{bmatrix}\answer {1}&\answer {0}\\\answer {-1}&\answer {1}\end{bmatrix}\begin{bmatrix}\answer {1}&\answer {0}\\\answer {0}&\answer {-1}\end{bmatrix}\]

Let \(M=\begin{bmatrix}-1&0\\0&-1\end{bmatrix}\). Use the GeoGebra interactive above to visually examine the transformation induced by \(M\). What sequence of transformations is equivalent to the transformation induced by \(M\)?

Rotation by 180 degrees. Reflection about the \(x\)-axis, followed by a reflection about the \(y\)-axis. Reflection about the \(y\)-axis, followed by a reflection about the \(x\)-axis. All of the above.

Let \(M=\begin{bmatrix}0&1\\-1&0\end{bmatrix}\). Use the GeoGebra interactive above to visually examine the transformation induced by \(M\). What sequence of transformations is equivalent to the transformation induced by \(M\)?

Reflection about the \(x\)-axis, followed by a reflection about the line \(y=-x\). Reflection about the \(y\)-axis, followed by a reflection about the \(x\)-axis. All of the above. None of the above.

Practice Problems

Consider matrices \(M_v\) and \(M_h\) in (1) and (2).
(a)
If we were to allow \(k\) to be zero, what would the resulting transformations accomplish?
(b)
If \(k=0\), in what way would the resulting matrices be fundamentally different from matrices \(M_v\) and \(M_h\) \((k\neq 0)\)?
(c)
Do \(M_v\) and \(M_h\) \((k\neq 0)\) have inverses? What about \(M_v\) and \(M_h\) \((k= 0)\)?
(d)
What would happen if we allowed \(k\) to be negative?
Find a matrix \(M\) that would double the length of a photo horizontally, and triple the height of the photo.
\[M=\begin{bmatrix}\answer {2} & \answer {0}\\\answer {0} & \answer {3}\end{bmatrix}\]
(Sheared Sheep) Find a matrix that induces the transformation shown in the figure.
\[M=\begin{bmatrix}\answer {1} & \answer {\frac {1}{\sqrt {3}}}\\\answer {0} & \answer {1}\end{bmatrix}\]

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 \(\vec {i}\) and \(\vec {j}\) the columns of \(M\). We would obtain

\[M=\begin{bmatrix}1.4 & 0.4\\0.4 & 1.4\end{bmatrix}\]
Does this matrix describe the transformation? If so, prove it. If not, explain why not.
A transformation \(T:\RR ^2\rightarrow \RR ^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.
What is the image of \(\vec {0}\) under \(T\)?
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.
Find the product of \(M_{y=mx}M_{y=mx}\).
Prove that every point along the line \(y=\frac {3}{5}x\) in Example 9 is a fixed point.
The figure below shows a sequence of two matrix transformations that accomplishes a reflection about the line \(y=\frac {3}{5}x\). 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 9.

Example Source

Example 11 was adapted from Example 5.27 of Ken Kuttler’s A First Course in Linear Algebra. (CC-BY)

Ken Kuttler, A First Course in Linear Algebra, Lyryx 2017, Open Edition, p. 290.

Photo Credits

The following images are courtesy of Wikimedia Commons

Adrian Pingstone, A male Mandarin Duck at Slimbridge Wildfowl and Wetlands Centre, Gloucestershire, England. Public Domain

Ansgar Koreng, Facade of ARD-Hauptstadtstudio in Berlin-Mitte. CC-BY 4.0

Christoph Braun, Reflection of St. Michaelis Church in a window of St. Ansgar in Hamburg, Germany. Public Domain.

Daniel Gammert, Red-billed Gulls Chroicocephalus novaehollandiae scopulinus. Brighton Beach, New Zealand. Public Domain

I, Tony Wills, Red billed gull in Wellington Harbour, Wellington, New Zealand. CC-BY

Jackhynes, Lleyn sheep taken with a Sony Digital Camera at 3.2 megapixels in Devon, UK. Public Domain

Erik Davis, Chipmunk. CC-BY