Matrix Transformations
A matrix transformation moves points in the plane by multiplying each point, written as a column, by a 2 × 2 matrix. Different matrices rotate, reflect, stretch or shrink a figure. To transform a whole shape, put its vertices in the columns of one matrix and multiply once.
Before this lesson: Matrix Multiplication, Rotations, Reflections and Dilations
How a matrix moves a point
Write the point (x, y) as a column, \begin{bmatrix} x \\ y \end{bmatrix}. Multiply it by a 2 × 2 matrix. The product is a new column, and that column is the image point.
\begin{bmatrix} a & b \\ c & d \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix}The columns of the matrix tell you everything. The first column is where the point (1, 0) lands, and the second column is where (0, 1) lands. Every other point follows along, because the matrix keeps lines straight and keeps the origin fixed.
Transformation matrices
| Transformation | Matrix | Image of (x, y) |
|---|---|---|
| Rotate 90° counterclockwise | \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} | (-y, x) |
| Rotate 180° | \begin{bmatrix} -1 & 0 \\ 0 & -1 \end{bmatrix} | (-x, -y) |
| Rotate 90° clockwise (270° counterclockwise) | \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} | (y, -x) |
| Reflect across the x-axis | \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} | (x, -y) |
| Reflect across the y-axis | \begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix} | (-x, y) |
| Reflect across y = x | \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} | (y, x) |
| Reflect across y = -x | \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} | (-y, -x) |
| Dilate by a factor of k | \begin{bmatrix} k & 0 \\ 0 & k \end{bmatrix} | (kx, ky) |
| Stretch by h across and v up and down | \begin{bmatrix} h & 0 \\ 0 & v \end{bmatrix} | (hx, vy) |
For a rotation by any angle θ counterclockwise about the origin, use this matrix:
R_\theta = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}Two more facts are useful. To do one transformation and then another, multiply their matrices with the second one on the left: BA means “do A first, then B.” Also, the determinant tells you how areas change. The image’s area is |\det A| times the original area.
How to transform a figure with a matrix
- Choose the transformation matrix from the table, or build it from where (1, 0) and (0, 1) go.
- Write the figure’s vertices as the columns of a point matrix, in order.
- Multiply, with the transformation matrix on the left and the point matrix on the right.
- Read each column of the product as an image point.
Matrix transformation examples
Example 1: Rotate a triangle 90°
Triangle ABC has vertices A(1, 1), B(4, 1) and C(1, 3). Rotate it 90° counterclockwise about the origin.
R = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}Write the matrix for a 90° counterclockwise rotation.
P = \begin{bmatrix} 1 & 4 & 1 \\ 1 & 1 & 3 \end{bmatrix}Put the vertices A, B and C in the columns.
RP = \begin{bmatrix} 0(1) + (-1)(1) & 0(4) + (-1)(1) & 0(1) + (-1)(3) \\ 1(1) + 0(1) & 1(4) + 0(1) & 1(1) + 0(3) \end{bmatrix}Multiply each row of R by each column of P (see matrix multiplication).
RP = \begin{bmatrix} -1 & -1 & -3 \\ 1 & 4 & 1 \end{bmatrix}Simplify each entry.
Answer: A′(−1, 1), B′(−1, 4) and C′(−3, 1). Each image point follows the rule (x, y) \to (-y, x).
Example 2: Reflect a point across y = x
Reflect the point (2, −5) across the line y = x.
F = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}Write the matrix for a reflection across y = x.
F\begin{bmatrix} 2 \\ -5 \end{bmatrix} = \begin{bmatrix} 0(2) + 1(-5) \\ 1(2) + 0(-5) \end{bmatrix}Multiply each row by the column.
F\begin{bmatrix} 2 \\ -5 \end{bmatrix} = \begin{bmatrix} -5 \\ 2 \end{bmatrix}Simplify each entry.
Answer: (−5, 2). A reflection across y = x swaps the two coordinates.
Example 3: Build the matrix from two points
A transformation T sends (1, 0) to (2, 1) and (0, 1) to (−1, 3). Find its matrix, the image of (4, −2), and how T changes areas.
T = \begin{bmatrix} 2 & -1 \\ 1 & 3 \end{bmatrix}The image of (1, 0) is the first column, and the image of (0, 1) is the second.
T\begin{bmatrix} 4 \\ -2 \end{bmatrix} = \begin{bmatrix} 2(4) + (-1)(-2) \\ 1(4) + 3(-2) \end{bmatrix}Multiply each row by the column.
T\begin{bmatrix} 4 \\ -2 \end{bmatrix} = \begin{bmatrix} 8 + 2 \\ 4 - 6 \end{bmatrix}Multiply inside each entry (see multiplying integers).
T\begin{bmatrix} 4 \\ -2 \end{bmatrix} = \begin{bmatrix} 10 \\ -2 \end{bmatrix}Add and subtract.
\det T = 2(3) - (-1)(1)
Find the determinant with ad - bc.
\det T = 6 + 1
Multiply.
\det T = 7
Add.
Answer: The matrix is \begin{bmatrix} 2 & -1 \\ 1 & 3 \end{bmatrix}, the point (4, −2) maps to (10, −2), and T multiplies every area by 7.
Example 4: Rotate a point by 60°
Rotate the point (2, 2) by 60° counterclockwise about the origin. Give exact coordinates.
R_{60} = \begin{bmatrix} \cos 60^\circ & -\sin 60^\circ \\ \sin 60^\circ & \cos 60^\circ \end{bmatrix}Use the rotation matrix with θ = 60°.
R_{60} = \begin{bmatrix} \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{bmatrix}Use the exact values \cos 60^\circ = \frac{1}{2} and \sin 60^\circ = \frac{\sqrt{3}}{2} (see trig values of special angles).
R_{60}\begin{bmatrix} 2 \\ 2 \end{bmatrix} = \begin{bmatrix} \frac{1}{2}(2) - \frac{\sqrt{3}}{2}(2) \\ \frac{\sqrt{3}}{2}(2) + \frac{1}{2}(2) \end{bmatrix}Multiply each row by the column.
R_{60}\begin{bmatrix} 2 \\ 2 \end{bmatrix} = \begin{bmatrix} 1 - \sqrt{3} \\ \sqrt{3} + 1 \end{bmatrix}Simplify each entry.
Answer: (1 - \sqrt{3}, 1 + \sqrt{3}) \approx (-0.73, 2.73). As a check, a rotation keeps the distance from the origin. The original distance squared is 2^2 + 2^2 = 8, and the new one is (1 - \sqrt{3})^2 + (1 + \sqrt{3})^2 = 8 too.
Example 5: Word problem with two moves
In a video game, a ship sits at (5, 2) on the screen’s grid. The game turns the ship’s position 90° counterclockwise about the origin, then reflects it across the x-axis. Find one matrix that does both moves, and the ship’s new position.
R = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}Write the matrix for the 90° rotation, which happens first.
F = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}Write the matrix for the reflection across the x-axis, which happens second.
FR = \begin{bmatrix} 1(0) + 0(1) & 1(-1) + 0(0) \\ 0(0) + (-1)(1) & 0(-1) + (-1)(0) \end{bmatrix}Multiply, with the second move on the left.
FR = \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}Simplify. This is the reflection across y = -x.
FR\begin{bmatrix} 5 \\ 2 \end{bmatrix} = \begin{bmatrix} 0(5) + (-1)(2) \\ (-1)(5) + 0(2) \end{bmatrix}Multiply the combined matrix by the ship’s position.
FR\begin{bmatrix} 5 \\ 2 \end{bmatrix} = \begin{bmatrix} -2 \\ -5 \end{bmatrix}Simplify each entry.
Answer: The combined matrix is \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}, and the ship moves to (−2, −5). Check it one move at a time: the rotation sends (5, 2) to (−2, 5), and the reflection sends (−2, 5) to (−2, −5).
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Multiplying in the wrong order | Writing PR instead of RP | The transformation matrix goes on the left of the point matrix. |
| Wrong order for two moves | Using RF for “rotate, then reflect” | The first move goes on the right: FR. |
| Writing a point as a row | Putting \begin{bmatrix} 2 & -5 \end{bmatrix} to the right of a 2 × 2 matrix | Write each point as a column so the product is defined. |
| Mixing up the direction of a 90° turn | Using \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} for counterclockwise | That matrix turns clockwise. Counterclockwise is \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}. |
| Minus sign in the wrong place | Putting the minus sign on the lower \sin\theta | The minus sign goes on the top-right entry, -\sin\theta. |
| Taking the determinant’s sign as the area factor | Saying a reflection multiplies area by −1 | Use the absolute value. A reflection keeps the area the same. |
Matrices and the rules from geometry
Every coordinate rule from Geometry has a matrix. The matrix version makes it easy to combine moves: multiply the matrices once, as in compositions of transformations, instead of moving every point twice.
The rotation matrix comes from the unit circle. Rotating (1, 0) by θ lands on (\cos\theta, \sin\theta), which is the first column. Rotating (0, 1) by θ lands on (-\sin\theta, \cos\theta), the second column.
Practice problems
- Rotate the point (2, 5) by 90° counterclockwise about the origin.
- Reflect the point (−3, 4) across the y-axis.
- Rotate the point (6, −1) by 180° about the origin.
- Dilate the triangle with vertices (1, 2), (3, 0) and (0, −2) by a factor of 3.
- Find the image of (3, −4) under the matrix \begin{bmatrix} 2 & 1 \\ 0 & 1 \end{bmatrix}.
- A transformation sends (1, 0) to (0, −1) and (0, 1) to (1, 0). Write its matrix and name the transformation.
- The matrix \begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix} is applied to a region with an area of 5 square units. Find the area of the image.
- Rotate the point (4, 0) by 30° counterclockwise about the origin. Give exact coordinates.
- Find one matrix that rotates 180° and then reflects across the y-axis. Use it to transform (2, 7).
- A designer stretches a picture with the matrix \begin{bmatrix} 1.5 & 0 \\ 0 & 2 \end{bmatrix}. The picture is a rectangle with corners (0, 0), (8, 0), (8, 5) and (0, 5). Find the image of the corner (8, 5) and the new area.
Show answers
1.
R\begin{bmatrix} 2 \\ 5 \end{bmatrix} = \begin{bmatrix} 0(2) + (-1)(5) \\ 1(2) + 0(5) \end{bmatrix}Use the 90° matrix R = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} and multiply each row by the column.
R\begin{bmatrix} 2 \\ 5 \end{bmatrix} = \begin{bmatrix} -5 \\ 2 \end{bmatrix}Simplify each entry.
Answer: (−5, 2)
2.
F\begin{bmatrix} -3 \\ 4 \end{bmatrix} = \begin{bmatrix} (-1)(-3) + 0(4) \\ 0(-3) + 1(4) \end{bmatrix}Use F = \begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix} for the y-axis and multiply.
F\begin{bmatrix} -3 \\ 4 \end{bmatrix} = \begin{bmatrix} 3 \\ 4 \end{bmatrix}Simplify each entry.
Answer: (3, 4)
3.
R\begin{bmatrix} 6 \\ -1 \end{bmatrix} = \begin{bmatrix} (-1)(6) + 0(-1) \\ 0(6) + (-1)(-1) \end{bmatrix}Use R = \begin{bmatrix} -1 & 0 \\ 0 & -1 \end{bmatrix} for 180° and multiply.
R\begin{bmatrix} 6 \\ -1 \end{bmatrix} = \begin{bmatrix} -6 \\ 1 \end{bmatrix}Simplify each entry.
Answer: (−6, 1)
4.
DP = \begin{bmatrix} 3(1) + 0(2) & 3(3) + 0(0) & 3(0) + 0(-2) \\ 0(1) + 3(2) & 0(3) + 3(0) & 0(0) + 3(-2) \end{bmatrix}Multiply D = \begin{bmatrix} 3 & 0 \\ 0 & 3 \end{bmatrix} by the point matrix P = \begin{bmatrix} 1 & 3 & 0 \\ 2 & 0 & -2 \end{bmatrix}.
DP = \begin{bmatrix} 3 & 9 & 0 \\ 6 & 0 & -6 \end{bmatrix}Simplify each entry.
Answer: (3, 6), (9, 0) and (0, −6)
5.
A\begin{bmatrix} 3 \\ -4 \end{bmatrix} = \begin{bmatrix} 2(3) + 1(-4) \\ 0(3) + 1(-4) \end{bmatrix}Call the matrix A and multiply each row by the column.
A\begin{bmatrix} 3 \\ -4 \end{bmatrix} = \begin{bmatrix} 6 - 4 \\ 0 - 4 \end{bmatrix}Multiply inside each entry.
A\begin{bmatrix} 3 \\ -4 \end{bmatrix} = \begin{bmatrix} 2 \\ -4 \end{bmatrix}Simplify.
Answer: (2, −4)
6.
T = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}The image of (1, 0) is the first column, and the image of (0, 1) is the second.
T\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} y \\ -x \end{bmatrix}Multiply by a general point to see the rule.
The rule is (x, y) \to (y, -x), so T is a rotation of 90° clockwise (270° counterclockwise).
7.
\det A = 3(4) - 1(2)
Call the matrix A and find its determinant with ad - bc.
\det A = 12 - 2
Multiply.
\det A = 10
Subtract.
\text{new area} = 10(5) = 50Multiply the old area by |\det A| = 10.
Answer: 50 square units
8.
R_{30} = \begin{bmatrix} \frac{\sqrt{3}}{2} & -\frac{1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix}Use \cos 30^\circ = \frac{\sqrt{3}}{2} and \sin 30^\circ = \frac{1}{2} in the rotation matrix.
R_{30}\begin{bmatrix} 4 \\ 0 \end{bmatrix} = \begin{bmatrix} \frac{\sqrt{3}}{2}(4) - \frac{1}{2}(0) \\ \frac{1}{2}(4) + \frac{\sqrt{3}}{2}(0) \end{bmatrix}Multiply each row by the column.
R_{30}\begin{bmatrix} 4 \\ 0 \end{bmatrix} = \begin{bmatrix} 2\sqrt{3} \\ 2 \end{bmatrix}Simplify each entry.
Answer: (2\sqrt{3}, 2) \approx (3.46, 2)
9.
F_yR = \begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} -1 & 0 \\ 0 & -1 \end{bmatrix}Put the y-axis reflection (the second move) on the left of the 180° rotation.
F_yR = \begin{bmatrix} (-1)(-1) + 0(0) & (-1)(0) + 0(-1) \\ 0(-1) + 1(0) & 0(0) + 1(-1) \end{bmatrix}Multiply each row by each column.
F_yR = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}Simplify. This is the reflection across the x-axis.
F_yR\begin{bmatrix} 2 \\ 7 \end{bmatrix} = \begin{bmatrix} 1(2) + 0(7) \\ 0(2) + (-1)(7) \end{bmatrix}Multiply by the point.
F_yR\begin{bmatrix} 2 \\ 7 \end{bmatrix} = \begin{bmatrix} 2 \\ -7 \end{bmatrix}Simplify each entry.
Answer: the combined matrix is \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}, and (2, 7) maps to (2, −7).
10.
S\begin{bmatrix} 8 \\ 5 \end{bmatrix} = \begin{bmatrix} 1.5(8) + 0(5) \\ 0(8) + 2(5) \end{bmatrix}Call the stretch matrix S and multiply each row by the column.
S\begin{bmatrix} 8 \\ 5 \end{bmatrix} = \begin{bmatrix} 12 \\ 10 \end{bmatrix}Simplify each entry.
\det S = 1.5(2) - 0(0)
Find the determinant, the area factor.
\det S = 3
Multiply and subtract.
\text{new area} = 3(8 \cdot 5)The old area is 8 · 5 square units. Multiply it by 3.
\text{new area} = 3(40) = 120Multiply.
Answer: the corner moves to (12, 10), and the new area is 120 square units, the area of a 12 by 10 rectangle.
Matrix transformations FAQ
What is a transformation matrix?
It is a matrix that moves points when you multiply it by them. A 2 × 2 matrix times a point (x, y), written as a column, gives the image point.
What is the matrix for a 90 degree rotation?
For a 90° counterclockwise rotation about the origin, the matrix is \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}. It sends (x, y) to (−y, x).
How do you combine two transformations with matrices?
Multiply their matrices, with the second transformation on the left. The product is one matrix that does both moves in order.
What does the determinant tell you about a transformation?
Its absolute value is the area scale factor. A negative determinant also means the transformation flips the figure over, as a reflection does.
Summary
- To transform a point, write it as a column and multiply, with the matrix on the left.
- The first column of the matrix is the image of (1, 0), and the second is the image of (0, 1).
- A rotation by θ uses \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}.
- For “A first, then B,” use the product BA.
- Areas are multiplied by |\det A|.
Previous lesson: Cramer’s Rule
Next lesson: Focus and Directrix of a Parabola
Back to the Precalculus Index