What a Transformation Matrix Is
A transformation matrix is a square matrix that maps the coordinates of a vector to new coordinates by matrix multiplication. When a transformation matrix $T$ of order $n \times n$ multiplies a column vector $\mathbf{v}$ with $n$ components, it produces a new vector $\mathbf{v}'$ in the same space:
$$\mathbf{v}' = T,\mathbf{v}$$
For a flat 2D plane, $T$ is a $2 \times 2$ matrix. For 3D space it is $3 \times 3$. The transformation acts on the whole coordinate system at once, which is why a single matrix can reposition an entire figure. A rotation matrix is one familiar special case — the kind of transformation matrix that turns without distorting.
The key idea: the columns of $T$ tell you where the basis vectors go. The first column is where $(1, 0)$ lands; the second column is where $(0, 1)$ lands. Once you know those two destinations, the matrix knows where every other point goes.
How Do You Apply a Transformation Matrix to a Vector?
You place the vector's coordinates in a column and multiply on the left. Take $\mathbf{v} = \begin{bmatrix} x \ y \end{bmatrix}$ and a transformation matrix $T = \begin{bmatrix} a & b \ c & d \end{bmatrix}$. Then
$$T\mathbf{v} = \begin{bmatrix} a & b \ c & d \end{bmatrix}\begin{bmatrix} x \ y \end{bmatrix} = \begin{bmatrix} ax + by \ cx + dy \end{bmatrix}$$
The order matters: the matrix sits on the left, the column vector on the right. If you write the vector as a row and multiply on the other side, you get a different (transposed) convention, and mixing the two is where a lot of wrong answers come from. For the full mechanics of multiplying, see multiplication of matrices.
The Types of Transformation Matrix
There are five transformations you will meet again and again. Each has a recognisable matrix shape.
Scaling (stretching): Enlarges or shrinks distances along the axes. Scale by $k_x$ along x and $k_y$ along y with $\begin{bmatrix} k_x & 0 \ 0 & k_y \end{bmatrix}$. With $k = 2$ on both, the figure doubles in size.
Rotation: Turns the figure about the origin by angle $\theta$ using $\begin{bmatrix} \cos\theta & -\sin\theta \ \sin\theta & \cos\theta \end{bmatrix}$. Length is preserved.
Shear: Slides one coordinate in proportion to the other, leaning the figure. A shear along x is $\begin{bmatrix} 1 & k \ 0 & 1 \end{bmatrix}$; along y it is $\begin{bmatrix} 1 & 0 \ k & 1 \end{bmatrix}$.
Reflection: Mirrors the figure across an axis. Reflection in the x-axis is $\begin{bmatrix} 1 & 0 \ 0 & -1 \end{bmatrix}$; in the y-axis, $\begin{bmatrix} -1 & 0 \ 0 & 1 \end{bmatrix}$; in the line $y = x$, $\begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix}$.
Translation: Shifts a figure without rotating or resizing it. Pure translation is not a linear map, so in 2D it cannot be written as a $2 \times 2$ matrix — it is handled with homogeneous coordinates as a $3 \times 3$ matrix $\begin{bmatrix} 1 & 0 & t_x \ 0 & 1 & t_y \ 0 & 0 & 1 \end{bmatrix}$.
That last point is the one most lists gloss over. Translation is the reason graphics engines use $3 \times 3$ (and in 3D, $4 \times 4$) matrices instead of the bare $2 \times 2$, because the extra row and column let a shift ride along with the other transformations in a single multiply.
What Are the Properties of a Transformation Matrix?
A few properties hold for every transformation matrix and explain how the types above behave.
The determinant measures area change. For a $2 \times 2$ transformation matrix, $\det T$ is the factor by which area scales. A determinant of 1 preserves area (rotations), a value above 1 enlarges, between 0 and 1 shrinks, and a negative determinant signals a flip (reflections have $\det = -1$).
A zero determinant collapses the figure. If $\det T = 0$, the matrix squashes the plane onto a line or a point, and the transformation cannot be undone — there is no inverse.
Invertible transformations have an inverse matrix. When $\det T \neq 0$, the transformation can be reversed by $T^{-1}$. Scaling by $k$ reverses with scaling by $\tfrac{1}{k}$; a rotation by $\theta$ reverses with a rotation by $-\theta$.
Composition is matrix multiplication. Applying transformation $T_1$ then $T_2$ is the single matrix $T_2 T_1$ — and because matrix multiplication is not commutative, the order matters.
The identity matrix leaves everything fixed. $\begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix}$ maps every point to itself — the "do nothing" transformation.
Examples of Transformation Matrix
Example 1
Apply the scaling matrix $\begin{bmatrix} 2 & 0 \ 0 & 3 \end{bmatrix}$ to the point $(1, 1)$.
$$\begin{bmatrix} 2 & 0 \ 0 & 3 \end{bmatrix}\begin{bmatrix} 1 \ 1 \end{bmatrix} = \begin{bmatrix} 2 \ 3 \end{bmatrix}$$
The x-coordinate doubles, the y-coordinate triples. Final answer: $(2, 3)$.
Example 2 (the tempting shortcut that does not work)
Reflect the point $(4, 1)$ across the line $y = x$.
Wrong attempt. A student decides reflecting across $y = x$ just means "make both coordinates negative," and writes the answer as $(-4, -1)$.
The break. Negating both coordinates is a $180°$ rotation about the origin, not a reflection across $y = x$. Reflecting across $y = x$ should swap the coordinates, sending $(4, 1)$ to $(1, 4)$, which sits on the opposite side of the diagonal — exactly what a mirror does.
Correct. Use the reflection matrix $\begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix}$:
$$\begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix}\begin{bmatrix} 4 \ 1 \end{bmatrix} = \begin{bmatrix} 1 \ 4 \end{bmatrix}$$
Final answer: $(1, 4)$.
Example 3
Apply the shear $\begin{bmatrix} 1 & 2 \ 0 & 1 \end{bmatrix}$ to the point $(3, 2)$.
$$\begin{bmatrix} 1 & 2 \ 0 & 1 \end{bmatrix}\begin{bmatrix} 3 \ 2 \end{bmatrix} = \begin{bmatrix} 3 + 4 \ 2 \end{bmatrix} = \begin{bmatrix} 7 \ 2 \end{bmatrix}$$
The y-coordinate is unchanged, while x is pushed across by $2y = 4$. Final answer: $(7, 2)$.
Example 4
Find the constant $a$ in the shear $\begin{bmatrix} 1 & a \ 0 & 1 \end{bmatrix}$ that maps $(3, 2)$ to $(7, 2)$.
The transformation gives $\begin{bmatrix} 3 + 2a \ 2 \end{bmatrix}$. Set the first entry equal to 7:
$$3 + 2a = 7$$
$$2a = 4$$
$$a = 2$$
Final answer: $a = 2$. (This is the reverse direction of Example 3 — finding the matrix from the result.)
Example 5
Transform the vector $5\mathbf{i} + 4\mathbf{j}$ using $T = \begin{bmatrix} 2 & -3 \ 1 & 2 \end{bmatrix}$.
$$\begin{bmatrix} 2 & -3 \ 1 & 2 \end{bmatrix}\begin{bmatrix} 5 \ 4 \end{bmatrix} = \begin{bmatrix} 10 - 12 \ 5 + 8 \end{bmatrix} = \begin{bmatrix} -2 \ 13 \end{bmatrix}$$
Final answer: $-2\mathbf{i} + 13\mathbf{j}$.
Example 6
Compose a reflection in the x-axis with a scaling by 2, then apply to $(1, 3)$.
Combine the two into one matrix by multiplying them. Scaling $S = \begin{bmatrix} 2 & 0 \ 0 & 2 \end{bmatrix}$ and reflection $F = \begin{bmatrix} 1 & 0 \ 0 & -1 \end{bmatrix}$ compose as
$$SF = \begin{bmatrix} 2 & 0 \ 0 & 2 \end{bmatrix}\begin{bmatrix} 1 & 0 \ 0 & -1 \end{bmatrix} = \begin{bmatrix} 2 & 0 \ 0 & -2 \end{bmatrix}$$
Apply to $(1, 3)$:
$$\begin{bmatrix} 2 & 0 \ 0 & -2 \end{bmatrix}\begin{bmatrix} 1 \ 3 \end{bmatrix} = \begin{bmatrix} 2 \ -6 \end{bmatrix}$$
Final answer: $(2, -6)$ — scaled up and flipped below the x-axis in a single multiplication.
Where Transformation Matrices Show Up — "moving everything at once"
The problem a transformation matrix was built to solve is repetition. Move one point and you can do it by hand. Move ten thousand points — the vertices of a 3D model, the pixels of an image, the nodes of a simulation — and you need a rule that applies to all of them in lockstep. A transformation matrix is that rule, frozen into a grid.
3D computer graphics. A single $4 \times 4$ transformation matrix carries scaling, rotation, and translation together, so a model can be placed, oriented, and sized in one multiply. This is why graphics pipelines lean on matrices instead of separate formulas.
Image editing and computer vision. Cropping, rotating, warping, and aligning images are transformation matrices applied to pixel grids.
Animation. Each frame multiplies an object's points by a slightly different transformation matrix, producing smooth motion.
Engineering and physics. Changing coordinate systems — say, from a sensor's frame to the world frame — is a transformation matrix at work.
A connection worth carrying forward: when a transformation preserves lengths and angles, it is an orthogonal matrix, and rotations and reflections are exactly those. Scaling and shear are not — they distort. The determinant of the matrix tells you how the area changes under the transformation, and a negative determinant signals a flip.
Where Students Trip Up on Transformation Matrices
Mistake 1: Mixing up the order of composition
Where it slips in: Combining two or more transformations into one matrix.
Don't do this: Multiplying the matrices in reading order and assuming it does not matter.
The correct way: The transformation applied first goes on the right, because it touches the vector first. Reflect-then-scale and scale-then-reflect can land in different places. The habit that fixes this is reading a product right to left as "first this, then that" rather than left to right.
Mistake 2: Confusing reflection across $y = x$ with negating coordinates
Where it slips in: Reflections, especially across the diagonal lines.
Don't do this: Treating reflection across $y = x$ as $(x, y) \to (-x, -y)$.
The correct way: Reflection across $y = x$ swaps coordinates: $(x, y) \to (y, x)$. Negating both is a $180°$ rotation. The first-instinct error is to assume every "flip" means a sign change, when the diagonal reflections are actually swaps — naming which line you are reflecting across before writing the matrix prevents the mix-up.
Mistake 3: Trying to write translation as a 2×2 matrix
Where it slips in: Any problem that asks you to shift a figure.
Don't do this: Looking for a $2 \times 2$ matrix that adds a constant to each coordinate. None exists — a $2 \times 2$ matrix always fixes the origin.
The correct way: Use homogeneous coordinates: append a 1 to the vector and use a $3 \times 3$ matrix with the shift in the last column.
The Short Version
A transformation matrix maps every point of a figure to a new location through a single matrix multiplication.
The five core types are scaling, rotation, shear, reflection, and translation — each with its own matrix shape.
The columns of the matrix tell you where the basis vectors $(1,0)$ and $(0,1)$ land.
Translation needs homogeneous coordinates ($3 \times 3$ in 2D) because a $2 \times 2$ matrix always fixes the origin.
The most common mistake is reflecting across $y = x$ by negating coordinates instead of swapping them.
Practice Questions on Transformation Matrix
Work through these, then check your answers below.
Scale the point $(2, 5)$ by a factor of 3 along both axes.
Reflect the point $(6, 2)$ across the y-axis.
Apply the shear $\begin{bmatrix} 1 & 3 \ 0 & 1 \end{bmatrix}$ to the point $(2, 4)$.
Compose a rotation by $90°$ with the shear $\begin{bmatrix} 1 & 1 \ 0 & 1 \end{bmatrix}$ (shear first, then rotate), then apply it to $(1, 0)$.
Find the determinant of the reflection matrix $\begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix}$ and state what it tells you.
Answer to Question 1: $\begin{bmatrix} 3 & 0 \ 0 & 3 \end{bmatrix}\begin{bmatrix} 2 \ 5 \end{bmatrix} = \begin{bmatrix} 6 \ 15 \end{bmatrix}$. The answer is $(6, 15)$.
Answer to Question 2: $\begin{bmatrix} -1 & 0 \ 0 & 1 \end{bmatrix}\begin{bmatrix} 6 \ 2 \end{bmatrix} = \begin{bmatrix} -6 \ 2 \end{bmatrix}$. The answer is $(-6, 2)$.
Answer to Question 3: $\begin{bmatrix} 1 & 3 \ 0 & 1 \end{bmatrix}\begin{bmatrix} 2 \ 4 \end{bmatrix} = \begin{bmatrix} 2 + 12 \ 4 \end{bmatrix} = \begin{bmatrix} 14 \ 4 \end{bmatrix}$. The answer is $(14, 4)$.
Answer to Question 4: The combined matrix is $R(90°),S$, where $R(90°) = \begin{bmatrix} 0 & -1 \ 1 & 0 \end{bmatrix}$ and $S = \begin{bmatrix} 1 & 1 \ 0 & 1 \end{bmatrix}$. Their product is $\begin{bmatrix} 0 & -1 \ 1 & 1 \end{bmatrix}$. Applied to $(1, 0)$: $\begin{bmatrix} 0 & -1 \ 1 & 1 \end{bmatrix}\begin{bmatrix} 1 \ 0 \end{bmatrix} = \begin{bmatrix} 0 \ 1 \end{bmatrix}$. The answer is $(0, 1)$.
Answer to Question 5: $\det = (0)(0) - (1)(1) = -1$. The negative determinant tells you the transformation flips orientation, which is what a reflection does.
Where to Go From Here
If composition order trips you, return to Mistake 1 and read the product right to left. At Bhanzu, our trainers teach transformations by tracking where the two basis vectors go, so the matrix becomes something you can read rather than memorise.
Want a live Bhanzu trainer to walk through more transformation matrix problems? Book a free demo class.
Was this article helpful?
Your feedback helps us write better content