6.1. Transformation matrices#

For convenience we tend to use matrices to represent linear transformations. Let \(T: V \to W\) be a linear transformation from the vector spaces \(V\) to \(W\) where \(V, W \in \mathbb{R}^n\). If \(\{\vec{v}_1, \vec{v}_2, \ldots, \vec{v}_n\}\) is a basis for \(V\) then for a vector \(\vec{u} \in V\)

\[ \vec{u} = u_1 \vec{v}_1 + u_2 \vec{v}_2 + \cdots + u_n \vec{v}_n, \]

and by the definition of a linear transformation we can apply a linear transformation \(T\) to the vectors \(\vec{u}\) and \(\vec{v}_1, \vec{v}_2, \ldots, \vec{v}_n\)

\[ T(\vec{u}) = u_1 T(\vec{v}_1) + u_2 T(\vec{v}_2) + \cdots + u_n T(\vec{v}_n), \]

so \(T(\vec{u})\) depends on the vectors \(T(\vec{v}_1), T(\vec{v}_2), \ldots, T(\vec{v}_n)\). We can write this as the matrix equation

\[\begin{split} \begin{align*} T(\vec{u}) &= \begin{pmatrix} \uparrow & \uparrow & & \uparrow \\ T(\vec{v}_1) & T(\vec{v}_2) & \cdots & T(\vec{v}_n) \\ \downarrow & \downarrow & & \downarrow \end{pmatrix} \begin{pmatrix} u_1 \\ u_2 \\ \vdots \\ u_n \end{pmatrix} = A \vec{u}. \end{align*} \end{split}\]

In other words we can apply a linear transformation simply by multiplying \(\vec{u}\) by a matrix \(A\).

Definition 6.3 (Transformation matrix)

Let \(T : V \to W\) be a linear transformation and \(A\) be a matrix such that

\[\begin{split} A = \begin{pmatrix} \uparrow & \uparrow & & \uparrow \\ T(\vec{v}_1) & T(\vec{v}_2) & \cdots & T(\vec{v}_n) \\ \downarrow & \downarrow & & \downarrow \end{pmatrix} \end{split}\]

then

\[ T(\vec{u}) = A\vec{u}. \]

\(A\) is said to be the matrix representation of the linear transformation \(T\) (also known as the transformation matrix).

Example 6.2

A linear transformation \(T:\mathbb{R}^2 \to \mathbb{R}^2\) is defined by \(T: (x, y)^\mathsf{T} \mapsto (3x + y, x + 2y)^\mathsf{T}\). Calculate the transformation matrix and use it to calculate \(T(1,1)^\mathsf{T}\).

Solution

Since we are mapping from \(\mathbb{R}^2\) the transformation matrix is

\[ A = \begin{pmatrix} T(\vec{e}_1) & T(\vec{e}_2) \end{pmatrix} \]

Applying the transformation to the standard basis vectors

\[\begin{split} \begin{align*} T(\vec{e}_1) = T\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 3(1) + 0 \\ 1 + 2(0) \end{pmatrix} = \begin{pmatrix} 3 \\ 1 \end{pmatrix}, \\ T(\vec{e}_2) = T\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 3(0) + 1 \\ 0 + 2(1) \end{pmatrix} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}, \end{align*} \end{split}\]

so the transformation matrix is

\[\begin{split} A = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix}. \end{split}\]

Applying the transformation matrix to \((1, 1)^\mathsf{T}\)

\[\begin{split} T\begin{pmatrix} 1 \\ 1 \end{pmatrix} = A \cdot \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 4 \\ 3 \end{pmatrix}. \end{split}\]

The affects of the linear transformation from Example 6.1 is illustrated in Fig. 6.1. Note that the transformation \(T\) can be thought of as changing the basis of the vector space. The unit square with respect to the basis \(\{\vec{e}_1, \vec{e}_1\}\) has been transformed into a unit parallelogram with respect to the basis \(\{ T(\vec{e}_1), T(\vec{e}_2)\}\).

../_images/6_linear_transformation.svg

Fig. 6.1 The affect of applying a linear transformation \(T: (x,y)^\mathsf{T} \mapsto (3x + y, x + 2y)^\mathsf{T}\) to the vector \((1,1)^\mathsf{T}\).#

6.1.1. Finding the transformation matrix from a set of images#

The calculation of the transformation matrix in Example 6.2 was straightforward as we knew what the transformation was. This will not always be a the case and we may know what the output of the transformation (known as the image) is but not the transformation itself. Consider a linear transformation \(T: \mathbb{R}^n \to \mathbb{R}^m\) applied to vectors \(\vec{u}_1, \vec{u}_2, \ldots, \vec{u}_n\). If \(A\) is the transformation matrix for \(T\) then

\[\begin{split} \begin{align*} A \begin{pmatrix} \uparrow & \uparrow & & \uparrow \\ \vec{u}_1 & \vec{u}_2 & \cdots & \vec{u}_n \\ \downarrow & \downarrow & & \downarrow \end{pmatrix} = \begin{pmatrix} \uparrow & \uparrow & & \uparrow \\ T(\vec{u}_1) & T(\vec{u}_2) & \cdots & T(\vec{u}_n) \\ \downarrow & \downarrow & & \downarrow \end{pmatrix} \end{align*} \end{split}\]

therefore

\[\begin{split} \begin{align*} A &= \begin{pmatrix} \uparrow & \uparrow & & \uparrow \\ T(\vec{u}_1) & T(\vec{u}_2) & \cdots & T(\vec{u}_n) \\ \downarrow & \downarrow & & \downarrow \end{pmatrix} \begin{pmatrix} \uparrow & \uparrow & & \uparrow \\ \vec{u}_1 & \vec{u}_2 & \cdots & \vec{u}_n \\ \downarrow & \downarrow & & \downarrow \end{pmatrix}^{-1} \end{align*} \end{split}\]

Theorem 6.1 (Determining the linear transformation given the inputs and image vectors)

Given a linear transformation \(T: \mathbb{R}^n \to \mathbb{R}^m\) applied to a set of \(n\) vectors \(\vec{u}_1, \vec{u}_2, \ldots, \vec{u}_n\) with known image vectors \(T(\vec{u}_1), T(\vec{u}_2), \ldots, T(\vec{u}_n)\) then the transformation matrix \(A\) for \(T\) is

(6.2)#\[ A = \begin{pmatrix} T(\vec{u}_1) & T(\vec{u}_2) & \cdots & T(\vec{u}_n) \end{pmatrix} \begin{pmatrix} \vec{u}_1 & \vec{u}_2 & \cdots & \vec{u}_n \end{pmatrix}^{-1}. \]

Example 6.3

Determine the transformation matrix \(A\) for the linear transformation \(T\) such that

\[\begin{split} \begin{align*} T\begin{pmatrix} 1 \\ 1 \end{pmatrix} &= \begin{pmatrix} 4 \\ 3 \end{pmatrix}, & T\begin{pmatrix} 1 \\ 2 \end{pmatrix} &= \begin{pmatrix} 5 \\ 5 \end{pmatrix}. \end{align*} \end{split}\]
Solution

The inverse of \((\vec{u}_1, \vec{u}_2)\) is

\[\begin{split} \begin{align*} \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}^{-1} &= \begin{pmatrix} 2 & -1 \\ -1 & 1 \end{pmatrix} \end{align*} \end{split}\]

Right multiplying the image matrix

\[\begin{split} \begin{align*} A &= \begin{pmatrix} 4 & 5 \\ 3 & 5 \end{pmatrix} \begin{pmatrix} 2 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix}. \end{align*} \end{split}\]

This is the transformation matrix from Example 6.2.

6.1.2. Inverse linear transformation#

Definition 6.4 (Inverse linear transformation)

Let \(T: V \to W\) be a linear transformation with the transformation matrix \(A\) then \(T\) has an inverse transformation denoted by \(T^{-1}: W \to V\) which reverses the affects of \(T\). If \(\vec{u} \in V\) and \(\vec{v} \in W\) then

\[\begin{split} \begin{align*} \vec{v} &= A \vec{u} \\ \therefore \vec{u} & = A^{-1}\vec{v}, \end{align*} \end{split}\]

where \(A^{-1}\) is the transformation matrix for \(T^{-1}\).

Example 6.4

Determine the inverse of the transformation \(T: \mathbb{R}^2 \to \mathbb{R}^2\) defined by \(T(x, y)^\mathsf{T} \mapsto (3 x + y, x + 2 y)^\mathsf{T}\) and calculate \(T^{-1}(4,3)^\mathsf{T}\).

Solution

We saw in Example 6.2 that the transformation matrix for \(T\) is

\[\begin{split} A = \begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix}, \end{split}\]

which has the inverse

\[\begin{split} A^{-1} = \frac{1}{5} \begin{pmatrix} 2 & -1 \\ -1 & 3 \end{pmatrix}. \end{split}\]

Determining the inverse transformation

\[\begin{split} \begin{align*} T^{-1}\begin{pmatrix} x \\ y \end{pmatrix} &= A^{-1} \cdot \begin{pmatrix} x \\ y \end{pmatrix} = \frac{1}{5} \begin{pmatrix} 2 & -1 \\ -1 & 3 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \\ &= \begin{pmatrix} \frac{2}{5}x - \frac{1}{5}y \\ -\frac{1}{5}x + \frac{3}{5}y \end{pmatrix}. \end{align*} \end{split}\]

Calculating \(T^{-1}\begin{pmatrix} 4 \\ 3 \end{pmatrix}\)

\[\begin{split} \begin{align*} A^{-1} \begin{pmatrix} 4 \\ 3 \end{pmatrix} &= \frac{1}{5} \begin{pmatrix} 2 & -1 \\ -1 & 3 \end{pmatrix} \begin{pmatrix} 4 \\ 3 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}. \end{align*} \end{split}\]