← mapVectors & Matrices

Linear Transformations of the Plane

⚗ Dr. Möbius, from the lab

A 2×22\times 2 matrix isn't a table of four numbers — it's a goddamn machine that moves the entire plane. Every point, every grid line, every shape gets relocated according to the matrix's instructions. If you've ever seen a geometric figure get stretched or rotated in a video game, a matrix multiplication is behind it. Strap in: this is where all the algebra we've been building detonates as genuine geometry.

THE BIG IDEA

Every 2×2 matrix encodes a linear transformation of the plane; the columns reveal exactly where the basis vectors land, and from those two destinations the fate of every point is determined.

The decoder ring: columns tell the whole story

A linear transformation T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 is a function satisfying two rules:

  1. T(u+v)=T(u)+T(v)T(\vec{u} + \vec{v}) = T(\vec{u}) + T(\vec{v}) (preserves addition)
  2. T(cv)=cT(v)T(c\vec{v}) = c T(\vec{v}) (preserves scalar multiplication)

From these two rules, something spectacular follows. Pay attention — the Federation of Boring Textbook Authors buries this in chapter twelve and calls it a "theorem" instead of leading with it. Any vector v=(xy)\vec{v} = \begin{pmatrix} x \\ y \end{pmatrix} can be written as xe^1+ye^2x\hat{e}_1 + y\hat{e}_2 where e^1=(10)\hat{e}_1 = \begin{pmatrix}1\\0\end{pmatrix} and e^2=(01)\hat{e}_2 = \begin{pmatrix}0\\1\end{pmatrix} are the standard basis vectors. Apply TT using the two rules:

T(v)=T(xe^1+ye^2)=xT(e^1)+yT(e^2)T(\vec{v}) = T(x\hat{e}_1 + y\hat{e}_2) = x T(\hat{e}_1) + y T(\hat{e}_2)

The entire transformation is determined by where the two basis vectors land. Know T(e^1)T(\hat{e}_1) and T(e^2)T(\hat{e}_2), and you know everything — every damn point on the plane included. This is the decoder ring:

(T(e^1)T(e^2))matrix Av=Av\underbrace{\begin{pmatrix} T(\hat{e}_1) & T(\hat{e}_2) \end{pmatrix}}_{\text{matrix }A}\vec{v} = A\vec{v}

Column 1 of AA is where e^1=(1,0)T\hat{e}_1 = (1,0)^T goes. Column 2 of AA is where e^2=(0,1)T\hat{e}_2 = (0,1)^T goes. If I hand you a 2×22\times 2 matrix, you can immediately read off the images of both basis vectors from the columns, and from those two images you know the entire transformation's behavior everywhere.

What "linear" means visually

A linear transformation is characterized by what it does to the plane:

  • Grid lines stay parallel and evenly spaced. Straight lines remain straight, and equally-spaced parallel lines remain equally-spaced and parallel.
  • The origin stays fixed. T(0)=T(0v)=0T(v)=0T(\vec{0}) = T(0 \cdot \vec{v}) = 0 \cdot T(\vec{v}) = \vec{0}.

If either of these fails, the transformation is not linear. A rotation about a point other than the origin? Not linear. A translation (sliding everything by (3,2)(3, 2))? Not linear — it moves the origin. Linear algebra is exclusively the mathematics of transformations that fix the origin and preserve the grid structure.

Drag the columns of the matrix below and watch the grid deform:

matrix transform — drag the columns
A·e₁=(1,0)A·e₂=(0,1)
A = [1 0 | 0 1]det A = 1

The greatest hits: rotation

Here's where the Trig stratum cashes its damn check. The rotation matrix that rotates every vector counterclockwise by angle θ\theta is:

Rθ=(cosθsinθsinθcosθ)R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}

Where does this come from? Apply the decoder ring: where does e^1=(1,0)T\hat{e}_1 = (1,0)^T go when rotated by θ\theta? It lands at (cosθ,sinθ)T(\cos\theta, \sin\theta)^T. Where does e^2=(0,1)T\hat{e}_2 = (0,1)^T go? It lands at (sinθ,cosθ)T(-\sin\theta, \cos\theta)^T. Those are the two columns. Done.

The trig sum-formula check. If we rotate by α\alpha and then by β\beta, the composition is rotation by α+β\alpha + \beta. So RαRβ=Rα+βR_\alpha R_\beta = R_{\alpha+\beta}. Let's multiply it out and see what we get. By the matrix product rule:

RαRβ=(cosαsinαsinαcosα)(cosβsinβsinβcosβ)R_\alpha R_\beta = \begin{pmatrix}\cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha\end{pmatrix}\begin{pmatrix}\cos\beta & -\sin\beta \\ \sin\beta & \cos\beta\end{pmatrix}

Entry (1,1)(1,1): cosαcosβ+(sinα)sinβ=cosαcosβsinαsinβ\cos\alpha\cos\beta + (-\sin\alpha)\sin\beta = \cos\alpha\cos\beta - \sin\alpha\sin\beta

Entry (2,1)(2,1): sinαcosβ+cosαsinβ\sin\alpha\cos\beta + \cos\alpha\sin\beta

But Rα+βR_{\alpha+\beta} has entry (1,1)=cos(α+β)(1,1) = \cos(\alpha+\beta) and entry (2,1)=sin(α+β)(2,1) = \sin(\alpha+\beta).

So the product demands: cos(α+β)=cosαcosβsinαsinβ\cos(\alpha+\beta) = \cos\alpha\cos\beta - \sin\alpha\sin\beta and sin(α+β)=sinαcosβ+cosαsinβ\sin(\alpha+\beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta. These are exactly the trig angle-addition formulas. The rotation matrix doesn't just use those formulas — multiplying rotation matrices proves them, from pure linear algebra. This is what it looks like when two branches of mathematics shake hands. The trig textbook authors should be furious; we proved their formulas in a linear algebra lab.

The other transformations

Scaling by factor aa horizontally and bb vertically: S=(a00b)S = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix} e^1(a,0)T\hat{e}_1 \to (a, 0)^T, e^2(0,b)T\hat{e}_2 \to (0, b)^T. Diagonal matrices are pure stretches along the coordinate axes.

Horizontal shear by factor kk: H=(1k01)H = \begin{pmatrix} 1 & k \\ 0 & 1 \end{pmatrix} e^1(1,0)T\hat{e}_1 \to (1, 0)^T (unchanged), e^2(k,1)T\hat{e}_2 \to (k, 1)^T (dragged sideways). Shears preserve area — file that away for the determinant lesson.

Reflection across the xx-axis: F=(1001)F = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} e^1\hat{e}_1 stays; e^2\hat{e}_2 flips to (0,1)T(0,-1)^T. The column picture tells you everything.

Composition: order matters and now you can see why

Rotating by 90°90° then shearing is NOT the same as shearing then rotating. You can feel this by thinking about it geometrically — the shear drags things horizontally, and whether you've been rotated first makes a massive difference. The matrix product captures this: R90°HHR90°R_{90°} H \ne H R_{90°}. I cannot stress this enough. Fucking up the order here will haunt you until the eigenvalue lesson.

To apply transformation BB first, then AA: compute ABAB. The rightmost matrix acts first. This is the same notation convention as function composition: (AB)(v)=A(B(v))(A \circ B)(\vec{v}) = A(B(\vec{v})).

Degenerate transformations: when the plane gets squashed

What if both columns of the matrix point in the same direction? Then the entire plane gets collapsed onto a single line. The transformation has squashed the plane's two-dimensional structure into one dimension — a geometric felony. A vector that was not in the image has nowhere to come from — the transformation is not invertible.

This is the preview of determinants: the determinant measures how much the area scales. When the plane collapses to a line, area goes to zero, and so does the determinant. That's next lesson — and it's where this dimension-murder gets a proper name and a body count.

🔬 SPECIMENS (worked examples)

Worked example 1 — decoding the matrix like a damn archaeologist

Describe the geometric effect of A=(0110)A = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} on the plane.

Apply the decoder ring to read the transformation:

  • Column 1 (0,1)T(0, 1)^T: this is where e^1=(1,0)T\hat{e}_1 = (1, 0)^T lands. It's been rotated to (0,1)T(0, 1)^T.
  • Column 2 (1,0)T(-1, 0)^T: this is where e^2=(0,1)T\hat{e}_2 = (0, 1)^T lands. It's been rotated to (1,0)T(-1, 0)^T.

The positive xx-axis now points up; the positive yy-axis now points left. This is a 90°90° counterclockwise rotation.

Verify with the rotation matrix formula: R90°=(cos90°sin90°sin90°cos90°)=(0110)R_{90°} = \begin{pmatrix}\cos 90° & -\sin 90° \\ \sin 90° & \cos 90°\end{pmatrix} = \begin{pmatrix}0 & -1\\ 1 & 0\end{pmatrix}. Matches.

Double-check on a specific vector: A(31)=((0)(3)+(1)(1)(1)(3)+(0)(1))=(13)A\begin{pmatrix}3\\1\end{pmatrix} = \begin{pmatrix}(0)(3)+(-1)(1)\\(1)(3)+(0)(1)\end{pmatrix} = \begin{pmatrix}-1\\3\end{pmatrix}. The point (3,1)(3,1) rotated 90°90° counterclockwise is (1,3)(-1,3). Correct.

Worked example 2 — building the matrix from the geometric description

Write the matrix for a reflection across the yy-axis.

Use the decoder ring: I need to know where e^1\hat{e}_1 and e^2\hat{e}_2 go under reflection across the yy-axis.

  • e^1=(1,0)T\hat{e}_1 = (1, 0)^T reflects to (1,0)T(-1, 0)^T (flipped across the yy-axis).
  • e^2=(0,1)T\hat{e}_2 = (0, 1)^T stays put: (0,1)T(0, 1)^T (it lies on the yy-axis, so reflecting across it does nothing).

Those images become the columns: A=(1001)A = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}

Verify on a specific point: reflect (3,2)(3, 2) across the yy-axis — it should go to (3,2)(-3, 2). A(32)=((1)(3)+(0)(2)(0)(3)+(1)(2))=(32)A\begin{pmatrix}3\\2\end{pmatrix} = \begin{pmatrix}(-1)(3)+(0)(2)\\(0)(3)+(1)(2)\end{pmatrix} = \begin{pmatrix}-3\\2\end{pmatrix} Correct.

Worked example 3 — the order trap that has murdered countless exam scores

Let R=(0110)R = \begin{pmatrix}0 & -1\\ 1 & 0\end{pmatrix} (rotation 90°90°) and H=(1201)H = \begin{pmatrix}1 & 2\\ 0 & 1\end{pmatrix} (horizontal shear). Compute RHRH and HRHR. Apply each to the vector (10)\begin{pmatrix}1\\0\end{pmatrix} to confirm they differ.

Compute RHRH (shear first, then rotate):

(RH)11=(0)(1)+(1)(0)=0,(RH)12=(0)(2)+(1)(1)=1(RH)_{11} = (0)(1)+(-1)(0)=0, \quad (RH)_{12} = (0)(2)+(-1)(1)=-1 (RH)21=(1)(1)+(0)(0)=1,(RH)22=(1)(2)+(0)(1)=2(RH)_{21} = (1)(1)+(0)(0)=1, \quad (RH)_{22} = (1)(2)+(0)(1)=2

RH=(0112)RH = \begin{pmatrix}0&-1\\1&2\end{pmatrix}

Compute HRHR (rotate first, then shear):

(HR)11=(1)(0)+(2)(1)=2,(HR)12=(1)(1)+(2)(0)=1(HR)_{11} = (1)(0)+(2)(1)=2, \quad (HR)_{12} = (1)(-1)+(2)(0)=-1 (HR)21=(0)(0)+(1)(1)=1,(HR)22=(0)(1)+(1)(0)=0(HR)_{21} = (0)(0)+(1)(1)=1, \quad (HR)_{22} = (0)(-1)+(1)(0)=0

HR=(2110)HR = \begin{pmatrix}2&-1\\1&0\end{pmatrix}

Apply to (1,0)T(1,0)^T:

RH(10)=(01),HR(10)=(21)RH\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}0\\1\end{pmatrix}, \quad HR\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}2\\1\end{pmatrix}

Different results. The order in which you apply transformations is critical. RHHRRH \ne HR.

☠ KNOWN HAZARDS

  • Forgetting the order of composition. "Apply BB first, then AA" is the matrix product ABAB. Writing BABA applies AA first — a different transformation entirely. Never commute matrices without checking whether the result is the same, or your calculation becomes fiction.

  • Thinking translations are linear. Sliding everything by a constant vector moves the origin and is NOT linear. Affine transformations (linear + translate) are important in graphics but are not matrix multiplications on R2\mathbb{R}^2. This is a classic exam trap and a favorite trick of bastard problem writers.

  • Reading the wrong column for the basis vector image. Column 1 is where (1,0)T(1,0)^T goes; column 2 is where (0,1)T(0,1)^T goes. If you read rows instead of columns, you'll build the wrong matrix and get a transposed transformation.

  • Expecting every matrix to be a "nice" named transformation. Most 2×22\times 2 matrices represent some combination of rotation, reflection, and scaling. They don't need to decompose cleanly into a single named type.

TL;DR

  • A linear transformation fixes the origin and maps straight evenly-spaced grid lines to straight evenly-spaced grid lines.

  • Decoder ring: column 1 of AA = image of e^1\hat{e}_1; column 2 = image of e^2\hat{e}_2. The whole transformation is encoded in the columns.

  • Rotation by θ\theta: Rθ=(cosθsinθsinθcosθ)R_\theta = \begin{pmatrix}\cos\theta & -\sin\theta\\\sin\theta & \cos\theta\end{pmatrix}. Multiplying rotation matrices proves the trig sum formulas.

  • Composition of transformations = matrix product; rightmost matrix acts first. Changing the order changes the result.

  • When columns are parallel/dependent, the plane collapses to a line — the transformation is singular and the determinant (next lesson) is zero.

unlocks