Matrix Transformations

Functions from \(\RR ^n\) into \(\RR ^m\)

In the past you have worked with functions \(f:\RR \longrightarrow \RR \). Most of the time such functions were defined algebraically. For example, we can define \(f\) by \(f(x)=x^2\). This function takes a number in the domain (\(\RR \)) and maps it to the square of the number in the codomain (also \(\RR \)). Previously, you might have visualized function \(f\) by looking at its graph, the set of all points of the form \((x, f(x))\) in \(\RR ^2\). In this course, we will find it more useful to look at functions diagrammatically. For instance, the diagram below shows that \(f\) maps 2 to 4. We say that 4 is the image of 2 under \(f\).

[Picture]

We will now consider functions that map \(\RR ^n\) into \(\RR ^m\). We will refer to such functions as transformations. There are two ways of thinking of transformations. A transformation \(T:\RR ^n\longrightarrow \RR ^m\) can take a vector in \(\RR ^n\) and map it to a vector in \(\RR ^m\), or it can map a point in \(\RR ^n\) to a point in \(\RR ^m\). We will think of transformations as acting on vectors or points interchangeably because every point \((x_1, x_2,\dots ,x_n)\) of \(\RR ^n\) can be interpreted as the tip of a vector \(\begin{bmatrix}x_1\\x_2\\\vdots \\x_n\end{bmatrix}\) in \(\RR ^n\). Matrix multiplication will provide us with initial tools for defining some transformations.

Examples of Matrix Transformations

Consider the matrix \(A=\begin{bmatrix}1&0.5\\0&1\end{bmatrix}\). The product of \(A\) with a \(2\times 1\) vector is a \(2\times 1\) vector. We can define a transformation \(T:\RR ^2\longrightarrow \RR ^2\) by \(T(\vec {x})=A\vec {x}\). This transformation can be applied to every vector of \(\RR ^2\). We will look at what it does to five vectors.

[Picture] [Picture] [Picture]

Even after looking at a handful of vectors it is often difficult to tell what the transformation actually accomplishes. This is why sometimes looking at points instead of vectors can be beneficial. If we consider every point in the left grid below as a tip of a vector, we can apply the transformation to each point to obtain the grid on the right.

[Picture] [Picture]

Applying \(T\) to a grid of points helps us see that the entire plane was sheared by the transformation.

We can also analyze the action of \(T\) algebraically. Start by finding the image of a generic vector \(\begin{bmatrix}x\\y\end{bmatrix}\).

\[T\left (\begin{bmatrix}x\\y\end{bmatrix}\right )=\begin{bmatrix}1&0.5\\0&1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}x+0.5y\\y\end{bmatrix}\]

We immediately see that the \(y\) component of the vector remains unchanged. We also see that the \(x\) component increases (or decreases) by an increment that depends on \(y\). When considering \(T\) as a transformation acting on points, we see that points located 1 unit above the \(x\)-axis, get shifted to the right by 0.5. Points located 2 units above, get shifted to the right by 1. The higher the point, the greater the shift. Points with negative \(y\)-coordinates get shifted to the left. In this fashion \(T\) shears the entire plane.

Now that we have seen the effect of functions defined via matrix multiplication, we can better appreciate the term transformation, as such functions distort the domain and the shapes located in it. The following Exploration will help you visualize this.

Make your own shape by moving points \(A, B, C, D, E, F, G\) in the left pane. (You can also move the entire figure by clicking and dragging the whole polygon.) The images of the points and the polygon under the transformation induced by \(M\) are shown on the right.

Try each of the following matrices to determine what each transformation accomplishes. (Type pi into GeoGebra to get \(\pi \).)

\[M_1=\begin{bmatrix}1&0\\0&2\end{bmatrix},\quad M_2=\begin{bmatrix}1/2&0\\0&1\end{bmatrix},\quad M_3=\begin{bmatrix}1&2\\0&1\end{bmatrix}\]
\[M_4=\begin{bmatrix}\cos (\pi )&-\sin (\pi )\\\sin (\pi )&\cos (\pi )\end{bmatrix},\quad M_5=\begin{bmatrix}\cos \left (\pi /4\right )&-\sin \left (\pi /4\right )\\\sin \left (\pi /4\right )&\cos \left (\pi /4\right )\end{bmatrix}\]
\[M_6=\begin{bmatrix}1&0\\0&-1\end{bmatrix},\quad M_7=\begin{bmatrix}0&1\\1&0\end{bmatrix},\quad M_8=\begin{bmatrix}1&1\\1&1\end{bmatrix}\]

Match the description of each transformation with the matrix that induces it.

Horizontal Shear: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Rotation by \(45^{\circ }\) counterclockwise: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Reflection about the \(x\)-axis: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Vertical Stretch: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Maps everything to a straight line: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Rotation through a \(180^{\circ }\) angle: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Horizontal compression: \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

Reflection about the line \(y=x\): \(M_1\) \(M_2\) \(M_3\)\(M_4\)\(M_5\)\(M_6\)\(M_7\)\(M_8\)

A \(2\times 2\) matrix induces a transformation from \(\RR ^2\) into \(\RR ^2\). An \(m\times n\) matrix can be multiplied by an \(n\times 1\) vector on the right, with the resulting product being an \(m\times 1\) vector. Therefore we can use an \(m\times n\) matrix \(A\) to define a transformation \(T:\RR ^n\longrightarrow \RR ^m\) by \(T(\vec {x})=A\vec {x}\).

Linearity of Matrix Transformations

Restating properties ?? and ?? of Section Matrix Multiplication in terms of matrix-vector multiplication gives us

\begin{eqnarray}\label {eq:linearityConstant} k(A\vec {v})&=&A(k\vec {v})\\ A(\vec {v}+\vec {w})&=&A\vec {v}+A\vec {w}\label {eq:linearityAdd} \end{eqnarray}

These two properties of matrix multiplications translate into analogous properties of matrix transformations. Suppose \(T:\RR ^n\longrightarrow \RR ^m\) is a matrix transformation, then for all vectors \(\vec {v}\), \(\vec {w}\) in \(\RR ^n\) and all constants \(k\) in \(\RR \),

\begin{equation}\label {eq:matrixTransProp1} T(k\vec {v})=kT(\vec {v}) \end{equation}

\begin{equation}\label {eq:matrixTransProp2} T(\vec {v}+\vec {w})=T(\vec {v})+T(\vec {w}) \end{equation}

In general, any transformation that satisfies (1) and (2) is called a linear transformation. As we have just seen, all matrix transformations are linear. We will study linear transformations in depth later in this chapter.

Where did \(\vec {i}\) Go?

In this section we will look at the images of standard unit vectors under a matrix transformation, and discuss why this information is helpful.

Let \(A=\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}\). Find the following products:
\[\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}\begin{bmatrix}1\\0\\0\end{bmatrix}=\begin{bmatrix}\answer {1}\\\answer {4}\\\answer {7}\end{bmatrix}\]
\[\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}\begin{bmatrix}0\\1\\0\end{bmatrix}=\begin{bmatrix}\answer {2}\\\answer {5}\\\answer {8}\end{bmatrix}\]
\[\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}\begin{bmatrix}0\\0\\1\end{bmatrix}=\begin{bmatrix}\answer {3}\\\answer {6}\\\answer {9}\end{bmatrix}\]

Let \(T:\RR ^3\longrightarrow \RR ^3\) be a matrix transformation induced by \(A\), then we can say that \(T\) maps \(\vec {i}\), \(\vec {j}\) and \(\vec {k}\) to the first, second and third columns of \(A\), respectively.

This nice property is not limited to transformations induced by square matrices. Let \(T:\RR ^3\rightarrow \RR ^2\) be a linear transformation induced by

\[A=\begin{bmatrix}1&-2&4\\0&3&5\end{bmatrix}\]
We will examine the effect of \(T\) on the standard unit vectors \(\vec {i}\), \(\vec {j}\) and \(\vec {k}\).
\[T(\vec {i})=A\vec {i}=\begin{bmatrix}\answer {1}\\\answer {0}\end{bmatrix},\quad T(\vec {j})=A\vec {j}=\begin{bmatrix}\answer {-2}\\\answer {3}\end{bmatrix}, \quad T(\vec {k})=A\vec {k}=\begin{bmatrix}\answer {4}\\\answer {5}\end{bmatrix}\]

Observe that the image of \(\vec {i}\) is the first column of \(A\), the image of \(\vec {j}\) is the second column of \(A\), and the image of \(\vec {k}\) is the third column.

We formalize our findings in Exploration as follows.

Why is it that knowing the images of standard unit vectors under a matrix transformation is helpful? Consider the following example.

Example 12 illustrates that a matrix transformation \(T:\RR ^n\longrightarrow \RR ^m\) is completely determined by where it maps the standard unit vectors. This is true because we can express every vector \(\vec {v}\) in \(\RR ^n\) as a linear combination of the standard unit vectors, then use (1) and (2) to find the image of \(\vec {v}\).

Practice Problems

Let \(T:\RR ^2\longrightarrow \RR ^2\) be a matrix transformation induced by the matrix \(A\). The GeoGebra window on the left shows the domain of \(T\), with standard unit vectors \(\vec {i}\) and \(\vec {j}\), and a vector \(\vec {x}\). The window on the right shows the codomain of \(T\), with the images of \(\vec {i}\), \(\vec {j}\) and \(\vec {x}\) plotted. To use this interactive, you can
  • Change the entries of matrix \(A\);
  • Change vector \(\vec {x}\) by dragging its tip.

Choose your matrix \(A\). Visually verify the following claims:

  • The image of \(\vec {i}\) is the first column of matrix \(A\).
  • The image of \(\vec {j}\) is the second column of matrix \(A\).

Let \(\vec {x}=\begin{bmatrix}2\\1\end{bmatrix}\). Complete the following statement by filling the blanks.

\[T(\vec {x})=T(\answer {2}\vec {i}+\answer {1}\vec {j})=\answer {2}T(\vec {i})+\answer {1}T(\vec {j})\]
Choose a different matrix \(A\), but keep vector \(\vec {x}\) the same. Does the above relationship still hold?

Change vector \(\vec {x}\) by dragging its tip. Observe the image of \(\vec {x}\) and its relationship to the images of \(\vec {i}\) and \(\vec {j}\). Complete the following statement for all vectors \(\begin{bmatrix}a\\b\end{bmatrix}\) in \(\RR ^2\).

\[T\left (\begin{bmatrix}a\\b\end{bmatrix}\right )=T(\answer {a}\vec {i}+\answer {b}\vec {j})=\answer {a}T(\vec {i})+\answer {b}T(\vec {j})\]
Show that a matrix transformation \(T:\mathbb {R}^{n}\rightarrow \mathbb {R}^{m}\) maps \(\vec {0}\) to \(\vec {0}\). In other words, \(T\left (\vec {0}\right ) = \vec {0}\).
Show that a matrix transformation \(T:\mathbb {R}^{n}\rightarrow \mathbb {R}^{m}\) maps a line in \(\RR ^n\) to a line (or the origin) in \(\RR ^m\).
A line in \(\RR ^n\) can be expressed as \(\vec {x}(t)=\vec {v}t+\vec {v}_0\). (See Formula ??.)