Finding Matrices of Transformations
students, imagine a computer game that changes every point on a grid in the same way. Maybe it stretches the whole image, flips it, or rotates it. π The question in this lesson is: how do we describe that rule using a matrix? In linear algebra, a matrix can act like a machine that transforms vectors. If we can find the right matrix, we can predict exactly what the transformation does to any vector.
What you will learn
By the end of this lesson, students, you should be able to:
- explain what a linear transformation is and why matrices can represent them,
- find the matrix of a transformation from what it does to basis vectors,
- apply the matrix to new vectors to check your work,
- connect matrix representations to the bigger idea of linear transformations.
This skill is important because many real systems use transformations: computer graphics, robotics, engineering models, and even image filters. A single matrix can store a complete rule for how points move. π
Linear transformations and why matrices matter
A transformation takes an input vector and turns it into an output vector. In this lesson, we focus on linear transformations, which are special because they preserve two key rules:
$$T(\mathbf{u}+\mathbf{v})=T(\mathbf{u})+T(\mathbf{v})$$
and
$$T(c\mathbf{u})=cT(\mathbf{u})$$
for any vectors $\mathbf{u}$ and $\mathbf{v}$ and any scalar $c$.
These rules mean the transformation behaves consistently. For example, if a transformation doubles every vector, then doubling first and transforming later gives the same result as transforming first and then doubling.
Not every transformation is linear. A shift or translation, such as moving every point $3$ units right, is not linear because it does not send the zero vector to the zero vector. But stretching, reflecting, rotating, and shearing are linear transformations.
Why are matrices useful here? Because every linear transformation in $\mathbb{R}^n$ can be represented by a matrix. Once we know the matrix, we can apply the transformation just by multiplying.
The key idea: columns come from basis vectors
To find the matrix of a linear transformation, the most important idea is this:
The columns of the matrix are the images of the standard basis vectors.
In $\mathbb{R}^2$, the standard basis vectors are
$$\mathbf{e}_1=\begin{bmatrix}1\\0\end{bmatrix}, \qquad \mathbf{e}_2=\begin{bmatrix}0\\1\end{bmatrix}$$
If a transformation $T$ is represented by a matrix $A$, then
$$A\mathbf{e}_1=T(\mathbf{e}_1), \qquad A\mathbf{e}_2=T(\mathbf{e}_2)$$
That means the first column of $A$ is $T(\mathbf{e}_1)$ and the second column is $T(\mathbf{e}_2)$.
Why does this work? Any vector in $\mathbb{R}^2$ can be written as
$$\begin{bmatrix}x\y\end{bmatrix}=x\mathbf{e}_1+y\mathbf{e}_2$$
Because the transformation is linear,
$$T\left(x\mathbf{e}_1+y\mathbf{e}_2\right)=xT(\mathbf{e}_1)+yT(\mathbf{e}_2)$$
So once we know what the transformation does to the basis vectors, we know what it does to every vector.
Example 1: a scaling transformation
Suppose $T$ stretches vectors by a factor of $2$ horizontally and a factor of $3$ vertically. Then
$$T\left(\begin{bmatrix}1\\0\end{bmatrix}\right)=\begin{bmatrix}2\\0\end{bmatrix}, \qquad T\left(\begin{bmatrix}0\\1\end{bmatrix}\right)=\begin{bmatrix}0\\3\end{bmatrix}$$
So the matrix is
$$A=\begin{bmatrix}2&0\\0&3\end{bmatrix}$$
Check it on a vector like $\begin{bmatrix}4\\5\end{bmatrix}$:
$$A\begin{bmatrix}4\\5\end{bmatrix}=\begin{bmatrix}2&0\\0&3\end{bmatrix}\begin{bmatrix}4\\5\end{bmatrix}=\begin{bmatrix}8\\15\end{bmatrix}$$
This matches the idea of stretching horizontally and vertically.
How to find a matrix from a rule
Sometimes a transformation is described in words or by a formula. Your job is to turn that rule into a matrix.
A good procedure is:
- Find $T(\mathbf{e}_1)$.
- Find $T(\mathbf{e}_2)$.
- Place those vectors as columns of the matrix.
Example 2: a shear transformation
Suppose a transformation sends
$$\begin{bmatrix}x\y\end{bmatrix}\mapsto \begin{bmatrix}x+2y\y\end{bmatrix}$$
Find the matrix.
First, apply the rule to $\mathbf{e}_1$:
$$T\left(\begin{bmatrix}1\\0\end{bmatrix}\right)=\begin{bmatrix}1+2(0)\\0\end{bmatrix}=\begin{bmatrix}1\\0\end{bmatrix}$$
Next, apply it to $\mathbf{e}_2$:
$$T\left(\begin{bmatrix}0\\1\end{bmatrix}\right)=\begin{bmatrix}0+2(1)\\1\end{bmatrix}=\begin{bmatrix}2\\1\end{bmatrix}$$
Put these in columns:
$$A=\begin{bmatrix}1&2\\0&1\end{bmatrix}$$
You can test it on a general vector:
$$A\begin{bmatrix}x\y\end{bmatrix}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}x\y\end{bmatrix}=\begin{bmatrix}x+2y\y\end{bmatrix}$$
So the matrix matches the rule exactly.
Why the method always works
Since any vector $\begin{bmatrix}x\y\end{bmatrix}$ can be built from $\mathbf{e}_1$ and $\mathbf{e}_2$, and since linearity lets us transform each part separately, the output is determined entirely by those two transformed basis vectors. This is the core reason matrix representations work.
Common transformation types and their matrices
Different geometric changes have familiar matrices. Learning a few patterns helps you recognize them quickly.
1. Reflection across the $x$-axis
This transformation sends
$$\begin{bmatrix}x\y\end{bmatrix}\mapsto \begin{bmatrix}x\\-y\end{bmatrix}$$
The matrix is
$$\begin{bmatrix}1&0\\0&-1\end{bmatrix}$$
because
$$T(\mathbf{e}_1)=\begin{bmatrix}1\\0\end{bmatrix}, \qquad T(\mathbf{e}_2)=\begin{bmatrix}0\\-1\end{bmatrix}$$
2. Rotation by $90^\circ$ counterclockwise
This sends
$$\begin{bmatrix}1\\0\end{bmatrix}\mapsto \begin{bmatrix}0\\1\end{bmatrix}, \qquad \begin{bmatrix}0\\1\end{bmatrix}\mapsto \begin{bmatrix}-1\\0\end{bmatrix}$$
So the matrix is
$$\begin{bmatrix}0&-1\\1&0\end{bmatrix}$$
3. Projection onto the $x$-axis
This sends every vector to its horizontal part:
$$\begin{bmatrix}x\y\end{bmatrix}\mapsto \begin{bmatrix}x\\0\end{bmatrix}$$
The matrix is
$$\begin{bmatrix}1&0\\0&0\end{bmatrix}$$
These examples show that matrix columns are not random. They tell the story of the transformation.
Working with matrices in a real example
Suppose a design app uses the transformation
$$T\left(\begin{bmatrix}x\y\end{bmatrix}\right)=\begin{bmatrix}3x-y\\2x+y\end{bmatrix}$$
Find the matrix.
Apply the rule to the first basis vector:
$$T\left(\begin{bmatrix}1\\0\end{bmatrix}\right)=\begin{bmatrix}3(1)-0\\2(1)+0\end{bmatrix}=\begin{bmatrix}3\\2\end{bmatrix}$$
Apply the rule to the second basis vector:
$$T\left(\begin{bmatrix}0\\1\end{bmatrix}\right)=\begin{bmatrix}3(0)-1\\2(0)+1\end{bmatrix}=\begin{bmatrix}-1\\1\end{bmatrix}$$
So the matrix is
$$A=\begin{bmatrix}3&-1\\2&1\end{bmatrix}$$
Now check it on $\begin{bmatrix}2\\5\end{bmatrix}$:
$$A\begin{bmatrix}2\\5\end{bmatrix}=\begin{bmatrix}3&-1\\2&1\end{bmatrix}\begin{bmatrix}2\\5\end{bmatrix}=\begin{bmatrix}1\\9\end{bmatrix}$$
Direct substitution into the rule gives
$$\begin{bmatrix}3(2)-5\\2(2)+5\end{bmatrix}=\begin{bmatrix}1\\9\end{bmatrix}$$
The answers match, so the matrix is correct β
What to watch out for
A few mistakes happen often:
- Mixing up columns and rows. For transformation matrices, the images of basis vectors go in columns, not rows.
- Forgetting that the transformation must be linear. A rule involving $x^2$, $y^2$, or a constant shift is not linear.
- Reversing the order of basis vectors. In $\mathbb{R}^2$, the standard basis is $\mathbf{e}_1$ then $\mathbf{e}_2$.
- Not checking your answer. Multiplying the matrix by a sample vector is a quick test.
A reliable habit is to always ask: βWhat happens to $\mathbf{e}_1$? What happens to $\mathbf{e}_2$?β That simple question solves most problems.
Conclusion
students, finding matrices of transformations is about turning a geometric rule into algebra. The main idea is that a linear transformation is completely determined by what it does to the standard basis vectors. Those transformed basis vectors become the columns of the matrix. Once the matrix is known, you can apply the transformation to any vector using matrix multiplication.
This connection is one of the most powerful ideas in linear algebra because it links pictures, rules, and calculations. Whether you are studying rotations, reflections, scaling, or shearing, the matrix gives a compact and exact description of the transformation. π
Study Notes
- A linear transformation satisfies $T(\mathbf{u}+\mathbf{v})=T(\mathbf{u})+T(\mathbf{v})$ and $T(c\mathbf{u})=cT(\mathbf{u})$.
- In $\mathbb{R}^2$, the standard basis vectors are $\mathbf{e}_1=\begin{bmatrix}1\\0\end{bmatrix}$ and $\mathbf{e}_2=\begin{bmatrix}0\\1\end{bmatrix}$.
- To find the matrix of a transformation, compute $T(\mathbf{e}_1)$ and $T(\mathbf{e}_2)$.
- Put $T(\mathbf{e}_1)$ in the first column and $T(\mathbf{e}_2)$ in the second column.
- The matrix represents the transformation because every vector is a combination of the basis vectors.
- Common examples include scaling, reflection, rotation, projection, and shear.
- Always check your matrix by multiplying it by a test vector and comparing the result with the transformation rule.
- The matrix form makes linear transformations easy to compute and use in real applications such as graphics and engineering.
