In Topic 4.12 you saw that every linear transformation of the plane is multiplication by a 2×2 matrix. This topic treats the matrix as a function and asks the questions you'd ask about any function. How do you build the matrix from a description like "rotate 60∘"? What does it do to areas? What happens when you compose two transformations, and how do you undo one?
The matrix behind a transformation
Write aij for the entry in row i and column j. Then the linear transformation
L(⟨x,y⟩)=⟨a11x+a12y,a21x+a22y⟩
is associated with the matrix
A=[a11a21a12a22]
Row i of A builds the ith component of the output. Column 1 holds the coefficients of x, and column 2 holds the coefficients of y.
The unit vectors give you the columns
The fastest way to find the matrix of a transformation is to ask where the unit vectors i=⟨1,0⟩ and j=⟨0,1⟩ go. Multiply each one by A:
The first column ofAis the image ofi, and the second column is the image ofj. So to build a matrix, figure out where i and j land and write those two vectors as the columns.
Why is that enough to know where every vector goes? Any vector can be built from the unit vectors, ⟨x,y⟩=xi+yj, and multiplying by A keeps that recipe:
A[xy]=x[a11a21]+y[a12a22]=x(Ai)+y(Aj)
In pictures, the unit square (with sides i and j) is sent to the parallelogram with sides Ai and Aj. Here's that picture for the matrix in Example 1.
Example 1: A matrix from the images of i and j
A linear transformation L sends i to ⟨2,1⟩ and j to ⟨−1,3⟩. Find the matrix of L, and use it to find L(⟨4,−2⟩).
The images of i and j are the columns:
A=[21−13]
Then
L(⟨4,−2⟩)=[21−13][4−2]=[8+24−6]=[10−2]
Check with the unit vector recipe: 4⟨2,1⟩−2⟨−1,3⟩=⟨8+2,4−6⟩=⟨10,−2⟩. Answer:L(⟨4,−2⟩)=⟨10,−2⟩.
Example 2: Reflecting over y=x
Find the matrix that reflects every vector over the line y=x.
Reflecting over y=x swaps the coordinates of a point. So i=⟨1,0⟩ lands on ⟨0,1⟩, and j=⟨0,1⟩ lands on ⟨1,0⟩. Those are the columns:
A=[0110]Check: [0110][xy]=[yx]
The same method gives the matrices for the common transformations:
Transformation
i goes to
j goes to
Matrix
Reflect over the x-axis
⟨1,0⟩
⟨0,−1⟩
[100−1]
Reflect over the y-axis
⟨−1,0⟩
⟨0,1⟩
[−1001]
Reflect over y=x
⟨0,1⟩
⟨1,0⟩
[0110]
Reflect over y=−x
⟨0,−1⟩
⟨−1,0⟩
[0−1−10]
Rotate 90∘ counterclockwise
⟨0,1⟩
⟨−1,0⟩
[01−10]
Rotate 180∘
⟨−1,0⟩
⟨0,−1⟩
[−100−1]
Dilate by a factor of k
⟨k,0⟩
⟨0,k⟩
[k00k]
Stretch horizontally by a factor of k
⟨k,0⟩
⟨0,1⟩
[k001]
Rotation matrices
The matrix that rotates every vector by an angle θcounterclockwise about the origin is
Rθ=[cosθsinθ−sinθcosθ]
You can build it with the unit vector method and the unit circle. The vector i points at angle 0 on the unit circle. Rotating it by θ lands it at angle θ, which is the point ⟨cosθ,sinθ⟩. That's column 1. The vector j points at angle 90∘, so it lands at angle θ+90∘:
⟨cos(θ+90∘),sin(θ+90∘)⟩=⟨−sinθ,cosθ⟩
That's column 2.
A few things to remember:
Clockwise rotations use−θ. Since cos(−θ)=cosθ and sin(−θ)=−sinθ, the clockwise matrix is [cosθ−sinθsinθcosθ].
Rotations keep lengths. A rotated vector has the same magnitude as the original.
Check withθ=90∘. You should get [01−10], which matches the table above.
Example 3: Rotating a vector
Rotate the vector ⟨4,2⟩ by 60∘ counterclockwise about the origin.
Check: the length shouldn't change. The original has length 42+22=20. For the image,
(2−3)2+(23+1)2=(7−43)+(13+43)=20
so its length is also 20. Answer:⟨2−3,23+1⟩≈⟨0.268,4.464⟩.
The determinant measures how area changes
In Topic 4.11, ∣det(A)∣ was the area of the parallelogram spanned by the columns of A. Now you know those columns are Ai and Aj, the images of the unit square's sides. So the unit square, with area 1, becomes a parallelogram with area ∣det(A)∣. In the unit square figure above, det(A)=(2)(3)−(−1)(1)=7, and the image of the unit square has area 7.
The same scale factor applies to every region, because any shape can be filled with tiny squares and each one gets scaled by the same amount. So the absolute value of the determinant is the dilation factor for area:
area of image=∣det(A)∣×area of original
∣det(A)∣>1: areas get bigger.
∣det(A)∣<1: areas shrink.
∣det(A)∣=1: areas stay the same. Rotations (det=cos2θ+sin2θ=1) and reflections (det=−1) are like this.
det(A)=0: the whole plane gets squashed onto a line (or a single point), and every region ends up with area 0.
A negative determinant means the transformation also flips the plane over, the way a reflection does. For area, only the absolute value matters.
Example 4: The area of an image
The triangle with vertices P(1,1), Q(3,1), and R(2,3) is transformed by A=[−2111] (the transformation from Topic 4.12, Example 3). Find the area of the image triangle.
The original triangle has base PQ=2 and height 2 (from y=1 up to y=3), so its area is 21(2)(2)=2. The determinant is
det(A)=(−2)(1)−(1)(1)=−3
so areas get multiplied by ∣−3∣=3. Answer: the image triangle has area 3×2=6 square units.
Check: the image vertices are P′(−1,2), Q′(−5,4), and R′(−1,5). Side P′R′ is vertical with length 3, and Q′ sits 4 units to its left, so the area is 21(3)(4)=6.
Composing linear transformations
Say L1(v)=Av and L2(v)=Bv. Doing L1 first and then L2 is the composition L2∘L1:
(L2∘L1)(v)=L2(L1(v))=B(Av)=(BA)v
Two facts come out of this:
The composition of two linear transformations is a linear transformation. It's multiplication by the 2×2 matrix BA, and every 2×2 matrix gives a linear transformation.
The matrix of the composition is the product of the two matrices, with the transformation that happens first on the right, next to v. It's just like f(g(x)), where g happens first even though it's written second.
Since BA and AB are usually different matrices, the order of the transformations matters.
Rotations are a good check on this rule. Rotating by α and then by β should be the same as rotating by α+β. Multiply RβRα, and the top left entry is cosβcosα−sinβsinα, which is cos(α+β) by the angle sum identity from Unit 3. The other entries work out the same way, so RβRα=Rα+β.
Example 5: Order matters
Let R rotate vectors 90∘ counterclockwise, and let F reflect vectors over the x-axis:
R=[01−10]F=[100−1]
Find the matrix for (a) rotating and then reflecting, and (b) reflecting and then rotating. Describe each one.
(a) The rotation happens first, so R goes on the right:
FR=[100−1][01−10]=[0−1−10]
This sends ⟨x,y⟩ to ⟨−y,−x⟩, a reflection over the line y=−x.
(b) Now the reflection happens first, so F goes on the right:
RF=[01−10][100−1]=[0110]
This sends ⟨x,y⟩ to ⟨y,x⟩, a reflection over the line y=x.
Test both with ⟨2,1⟩. Rotating gives ⟨−1,2⟩, and then reflecting gives ⟨−1,−2⟩, which is what FR gives. Reflecting first gives ⟨2,−1⟩, and then rotating gives ⟨1,2⟩, which is what RF gives. Same two steps, different order, different result. The figure follows a triangle through both orders (the dot marks the vertex that starts at (2,1), and the dashed triangle shows the result of the first step).
Inverse transformations
Two linear transformations are inverses if composing them, in either order, maps every vector back to itself:
L−1(L(v))=vandL(L−1(v))=v
If L(v)=Av, the inverse transformation uses the inverse matrix:
L−1(v)=A−1v
This works because the composition has matrix A−1A=I, and Iv=v for every vector.
So L has an inverse exactly when det(A)=0. The picture explains why. When det(A)=0, the plane gets squashed onto a line, and many different inputs land on the same output. There's no way to undo that, because you couldn't tell which input an output came from.
Two inverses you can find without any algebra:
The inverse of rotating by θ is rotating back by −θ. The formula agrees: det(Rθ)=1, and the swap-and-negate step turns Rθ into R−θ.
A reflection is its own inverse. Reflect twice over the same line and you're back where you started, so FF=I.
Example 6: Undoing and composing
Let L(v)=Av, where A=[3512].
(a) Explain why L has an inverse, and find a formula for L−1.
(b) A vector v satisfies L(v)=⟨4,7⟩. Find v.
(c) Let M be the transformation that applies L and then rotates 90∘ counterclockwise. Find the matrix of M and use it to find M(⟨1,1⟩).
(a)det(A)=(3)(2)−(1)(5)=1. That isn't 0, so L has an inverse. Swap, change signs, and divide by 1:
A−1=[2−5−13]L−1(⟨x,y⟩)=⟨2x−y,−5x+3y⟩
(b) Undo L by applying L−1 to the output:
v=A−1[47]=[2−5−13][47]=[8−7−20+21]=[11]
Check: A[11]=[3+15+2]=[47]. So v=⟨1,1⟩.
(c)L happens first, so A goes on the right, with the 90∘ rotation matrix on the left: