Linear Transformations

Study Sheet

Linear Transformations

Kernel, image, rotations and reflections

Maps That Respect Addition

Tip
The matrix IS the transformation
xAe₁ = (0, 1)Ae₂ = (−1, 0)
The quarter-turn carries the dashed unit square to the shaded one: e₁ ↦ (0, 1), e₂ ↦ (−1, 0).

A linear map is determined by where it sends the basis vectors, and those images are the columns of its matrix. Rotation by 90∘90^\circ counterclockwise sends e1↦(0,1)\mathbf e_1 \mapsto (0, 1) and e2↦(−1,0)\mathbf e_2 \mapsto (-1, 0), so its matrix is (0−110)\begin{pmatrix}0&-1\\1&0\end{pmatrix}; reflection across y=xy = x swaps e1\mathbf e_1 and e2\mathbf e_2, giving (0110)\begin{pmatrix}0&1\\1&0\end{pmatrix}. Composing maps multiplies their matrices.

A map TT is linear when T(u+v)=Tu+TvT(\mathbf u + \mathbf v) = T\mathbf u + T\mathbf v and T(cu)=cTuT(c\mathbf u) = cT\mathbf u. Every x=xe1+ye2\mathbf x = x\mathbf e_1 + y\mathbf e_2, so linearity forces Tx=xTe1+yTe2T\mathbf x = xT\mathbf e_1 + yT\mathbf e_2 — the whole map is fixed by two vectors. For the rotation, (3,1)=3e1+e2(3, 1) = 3\mathbf e_1 + \mathbf e_2 goes to 3(0,1)+(−1,0)=(−1,3)3(0, 1) + (-1, 0) = (-1, 3), and indeed (−1,3)(-1, 3) is (3,1)(3, 1) turned a quarter-turn.

Tip
Kernel and image

The kernel is everything sent to zero (the solution space of Ax=0A\mathbf x = \mathbf 0); the image is everything hit (the span of the columns). Their dimensions add to the number of input variables — rank–nullity, now with geometric meaning.

Both are subspaces, and they measure opposite things: the kernel is what the map destroys, the image is what it can produce. If Tu=TwT\mathbf u = T\mathbf w, then T(u−w)=0T(\mathbf u - \mathbf w) = \mathbf 0, so u−w\mathbf u - \mathbf w lies in the kernel; a map is one-to-one exactly when its kernel is {0}\{\mathbf 0\}. Every input dimension either survives into the image or is lost in the kernel, which is why the two dimensions add to the number of inputs.

Example
Determinants classify the geometry

A reflection has determinant −1-1 (flips orientation, preserves area); rotations have determinant +1+1; a projection has determinant 00 (it flattens). Two quarter-turns compose to R902=−IR_{90}^2 = -I: every point goes to its antipode.

Each claim is a determinant you can compute. A rotation matrix (cos⁡θ−sin⁡θsin⁡θcos⁡θ)\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix} has det⁡=cos⁡2θ+sin⁡2θ=1\det = \cos^2\theta + \sin^2\theta = 1; reflection across y=xy = x has det⁡=0−1=−1\det = 0 - 1 = -1; projection onto the xx-axis, (1000)\begin{pmatrix}1&0\\0&0\end{pmatrix}, has det⁡=0\det = 0. And R902=(0−110)2=−IR_{90}^2 = \begin{pmatrix}0&-1\\1&0\end{pmatrix}^2 = -I with det⁡(−I)=1\det(-I) = 1: a half-turn keeps both area and orientation.

Side note
Significance: geometry becomes computation

Every rotation of a 3D game character, every camera projection, every robot-arm pose is a linear (or affine) transformation composed from simpler ones by matrix multiplication. Kernel and image answer engineering questions directly: the kernel of a measurement matrix is what your sensors cannot see.

Try it
Try it: build a matrix from geometry

Write the matrix of the map that stretches horizontally by 33 and reflects vertically (sends yy to −y-y). What does its determinant say?

Show the answer

Track the basis vectors. e1=(1,0)\mathbf e_1 = (1, 0) is stretched to (3,0)(3, 0); e2=(0,1)\mathbf e_2 = (0, 1) is reflected to (0,−1)(0, -1). Those images are the columns: (300−1)\begin{pmatrix}3&0\\0&-1\end{pmatrix}. Its determinant is 3⋅(−1)−0=−33\cdot(-1) - 0 = -3: areas are multiplied by ∣−3∣=3|-3| = 3 and the negative sign records the flip. Test on a vector: (1,2)↦(3,−2)(1, 2) \mapsto (3, -2) — three times as wide, upside down.

Projections and Reflections Across a Line

Tip
Matrices from a direction vector

Let LL be the line through the origin along v\mathbf v. Projection onto LL and reflection across LL have matrices

P=vvTv⋅v,F=2P−I.P = \frac{\mathbf v\mathbf v^{\mathsf T}}{\mathbf v\cdot\mathbf v}, \qquad F = 2P - I.

PP keeps the part of x\mathbf x along v\mathbf v and kills the part across; FF keeps the part along and reverses the part across.

Split x\mathbf x into a piece along the line and a piece perpendicular to it. The along-piece is v⋅xv⋅vv\dfrac{\mathbf v\cdot\mathbf x}{\mathbf v\cdot\mathbf v}\mathbf v, and v(vTx)=(vvT)x\mathbf v(\mathbf v^{\mathsf T}\mathbf x) = (\mathbf v\mathbf v^{\mathsf T})\mathbf x turns that into a matrix times x\mathbf x. Reflection keeps the along-piece and negates the other: Fx=Px−(x−Px)=(2P−I)xF\mathbf x = P\mathbf x - (\mathbf x - P\mathbf x) = (2P - I)\mathbf x. Two checks follow from the geometry: projecting twice changes nothing, so P2=PP^2 = P; reflecting twice returns home, so F2=IF^2 = I.

Example
Worked: projecting onto y = 2x

Find the matrix of projection onto the line y=2xy = 2x and apply it to (3,1)(3, 1). The line runs along v=(1,2)\mathbf v = (1, 2) with v⋅v=5\mathbf v\cdot\mathbf v = 5, and vvT=(1224)\mathbf v\mathbf v^{\mathsf T} = \begin{pmatrix}1&2\\2&4\end{pmatrix}, so P=15(1224)P = \tfrac15\begin{pmatrix}1&2\\2&4\end{pmatrix}.

Apply it: P(31)=15(3+26+4)=(12)P\begin{pmatrix}3\\1\end{pmatrix} = \tfrac15\begin{pmatrix}3 + 2\\6 + 4\end{pmatrix} = \begin{pmatrix}1\\2\end{pmatrix}. Two checks: (1,2)(1, 2) is on the line, and the leftover (3,1)−(1,2)=(2,−1)(3, 1) - (1, 2) = (2, -1) is perpendicular to it, since (2,−1)⋅(1,2)=0(2, -1)\cdot(1, 2) = 0. The projection is the foot of the perpendicular from (3,1)(3, 1). Also det⁡P=125(4−4)=0\det P = \tfrac{1}{25}(4 - 4) = 0: projection flattens the plane onto a line, as it must.

Example
Worked: reflecting across the same line
xy(3, 1)(−1, 3)(1, 2)y = 2x
The foot of the perpendicular, (1, 2), is the midpoint of (3, 1) and its mirror image (−1, 3).

Reflect (3,1)(3, 1) across y=2xy = 2x. Use F=2P−I=25(1224)−(1001)=15(−3443)F = 2P - I = \tfrac25\begin{pmatrix}1&2\\2&4\end{pmatrix} - \begin{pmatrix}1&0\\0&1\end{pmatrix} = \tfrac15\begin{pmatrix}-3&4\\4&3\end{pmatrix}.

Then F(31)=15(−9+412+3)=(−13)F\begin{pmatrix}3\\1\end{pmatrix} = \tfrac15\begin{pmatrix}-9 + 4\\12 + 3\end{pmatrix} = \begin{pmatrix}-1\\3\end{pmatrix}. Check the geometry: the midpoint of (3,1)(3, 1) and (−1,3)(-1, 3) is (1,2)(1, 2), the foot found above, and both points are 10\sqrt{10} from the origin. The determinant is 125(−9−16)=−1\tfrac{1}{25}(-9 - 16) = -1, the signature of a reflection. And F2=125(9+16−12+12−12+1216+9)=IF^2 = \tfrac{1}{25}\begin{pmatrix}9 + 16&-12 + 12\\-12 + 12&16 + 9\end{pmatrix} = I ✓.

Side note
Where it goes wrong: forgetting to divide by v · v

Using vvT=(1224)\mathbf v\mathbf v^{\mathsf T} = \begin{pmatrix}1&2\\2&4\end{pmatrix} itself as the projection sends (3,1)(3, 1) to (5,10)(5, 10) — on the right line, but five times too far. The symptom is that applying it twice keeps growing: (vvT)2=5 vvT(\mathbf v\mathbf v^{\mathsf T})^2 = 5\,\mathbf v\mathbf v^{\mathsf T}, not vvT\mathbf v\mathbf v^{\mathsf T}. A true projection satisfies P2=PP^2 = P; dividing by v⋅v=5\mathbf v\cdot\mathbf v = 5 restores it (or use a unit vector from the start).

Try it
Try it: project onto the diagonal

Find the matrix of projection onto the line y=xy = x, apply it to (4,2)(4, 2), and find the matrix of reflection across the same line.

Show the answer

Take v=(1,1)\mathbf v = (1, 1), so v⋅v=2\mathbf v\cdot\mathbf v = 2 and P=12(1111)P = \tfrac12\begin{pmatrix}1&1\\1&1\end{pmatrix}. Then P(4,2)=12(6,6)=(3,3)P(4, 2) = \tfrac12(6, 6) = (3, 3): the leftover (1,−1)(1, -1) is perpendicular to (1,1)(1, 1) ✓. The reflection is F=2P−I=(1111)−(1001)=(0110)F = 2P - I = \begin{pmatrix}1&1\\1&1\end{pmatrix} - \begin{pmatrix}1&0\\0&1\end{pmatrix} = \begin{pmatrix}0&1\\1&0\end{pmatrix} — the swap matrix, as the gallery found by tracking e1\mathbf e_1 and e2\mathbf e_2. It sends (4,2)(4, 2) to (2,4)(2, 4), and the midpoint (3,3)(3, 3) is the projection.

Linear or Not?

Tip
Two tests, and one quick disqualifier

TT is linear exactly when T(u+v)=Tu+TvT(\mathbf u + \mathbf v) = T\mathbf u + T\mathbf v and T(cu)=cTuT(c\mathbf u) = cT\mathbf u for all vectors and scalars. A linear map always sends 0\mathbf 0 to 0\mathbf 0, so T(0)≠0T(\mathbf 0) \ne \mathbf 0 disqualifies a map at once. Formulas built only from sums of constant multiples of the input coordinates are linear; constants added on, products of coordinates, squares, and absolute values are not.

The tests say the map respects the two operations that define a vector space, which is what lets a matrix represent it. Geometrically, a linear map carries grid lines to grid lines: straight, parallel, and evenly spaced. T(0)=0T(\mathbf 0) = \mathbf 0 follows from scaling with c=0c = 0: T(0)=T(0u)=0 T(u)=0T(\mathbf 0) = T(0\mathbf u) = 0\,T(\mathbf u) = \mathbf 0. It is necessary but not sufficient — a map can fix the origin and still bend the grid.

Example
Worked: a shift is not linear

Is T(x,y)=(x+1, y)T(x, y) = (x + 1,\ y) linear? Check the disqualifier first: T(0,0)=(1,0)≠(0,0)T(0, 0) = (1, 0) \ne (0, 0).

So TT is not linear, and no matrix can represent it (a matrix sends 0\mathbf 0 to 0\mathbf 0). The additivity test fails too, for a concrete pair: T((1,0)+(1,0))=T(2,0)=(3,0)T((1, 0) + (1, 0)) = T(2, 0) = (3, 0), while T(1,0)+T(1,0)=(2,0)+(2,0)=(4,0)T(1, 0) + T(1, 0) = (2, 0) + (2, 0) = (4, 0). A translation is affine — linear plus a constant — which is why computer graphics adds an extra coordinate to turn translations into matrix products.

Example
Worked: fixing the origin is not enough
xy(2, 4)(2, 2)
T bends horizontal grid lines into parabolas. T(1, 0) = (1, 1); T(2, 0) = (2, 4), not 2T(1, 0) = (2, 2) (open dot).

Is T(x,y)=(x, y+x2)T(x, y) = (x,\ y + x^2) linear? It passes the quick test: T(0,0)=(0,0)T(0, 0) = (0, 0). Try scaling u=(1,0)\mathbf u = (1, 0) by 22: T(2u)=T(2,0)=(2,4)T(2\mathbf u) = T(2, 0) = (2, 4).

But 2T(u)=2(1,1)=(2,2)≠(2,4)2T(\mathbf u) = 2(1, 1) = (2, 2) \ne (2, 4). Scaling fails, so TT is not linear. The culprit is the square: doubling xx quadruples x2x^2. In the figure, the horizontal grid lines y=−1,0,1y = -1, 0, 1 are bent into parabolas — a linear map could never do that.

Example
Worked: differentiation is linear

Let D(p)=p′D(p) = p' on polynomials of degree at most 22. It is linear, because (p+q)′=p′+q′(p + q)' = p' + q' and (cp)′=cp′(cp)' = cp'. In the basis {1,x,x2}\{1, x, x^2\}, the images of the basis vectors are D(1)=0D(1) = 0, D(x)=1D(x) = 1, D(x2)=2xD(x^2) = 2x.

Their coordinate vectors (0,0,0)(0, 0, 0), (1,0,0)(1, 0, 0), (0,2,0)(0, 2, 0) are the columns: D=(010002000)D = \begin{pmatrix}0&1&0\\0&0&2\\0&0&0\end{pmatrix}. Test on p=3+2x+5x2p = 3 + 2x + 5x^2, coordinates (3,2,5)(3, 2, 5): D(325)=(2100)D\begin{pmatrix}3\\2\\5\end{pmatrix} = \begin{pmatrix}2\\10\\0\end{pmatrix}, which is 2+10x2 + 10x — exactly p′p' ✓. The kernel is the constants (dimension 11) and the image is the polynomials of degree at most 11 (dimension 22): 1+2=31 + 2 = 3 ✓. "Matrix" and "linear map" are the same idea even when the vectors are functions.

Side note
Where it goes wrong: stopping at T(0) = 0

"T(0,0)=(0,0)T(0, 0) = (0, 0), so TT is linear" is a common false conclusion. T(x,y)=(x, y+x2)T(x, y) = (x,\ y + x^2) fixes the origin and is not linear, as shown above; so does T(x,y)=(∣x∣,y)T(x, y) = (|x|, y), which fails with T(−1,0)=(1,0)≠−T(1,0)=(−1,0)T(-1, 0) = (1, 0) \ne -T(1, 0) = (-1, 0). The origin test can only rule a map out. To rule it in, check additivity and scaling for arbitrary inputs, or write TT as a matrix times x\mathbf x.

Try it
Try it: linear, and its matrix

Is T(x,y,z)=(x−2z, 3y)T(x, y, z) = (x - 2z,\ 3y) linear? If so, give its matrix, compute T(1,1,1)T(1, 1, 1), and find its kernel.

Show the answer

Each output coordinate is a sum of constant multiples of x,y,zx, y, z with no constant term, so TT is linear. Columns are the images of the basis vectors: T(e1)=(1,0)T(\mathbf e_1) = (1, 0), T(e2)=(0,3)T(\mathbf e_2) = (0, 3), T(e3)=(−2,0)T(\mathbf e_3) = (-2, 0), so the matrix is (10−2030)\begin{pmatrix}1&0&-2\\0&3&0\end{pmatrix}. Then T(1,1,1)=(1−2, 3)=(−1,3)T(1, 1, 1) = (1 - 2,\ 3) = (-1, 3). Kernel: x−2z=0x - 2z = 0 and 3y=03y = 0 give y=0y = 0, x=2zx = 2z, so the kernel is the line spanned by (2,0,1)(2, 0, 1) (check: T(2,0,1)=(2−2,0)=(0,0)T(2, 0, 1) = (2 - 2, 0) = (0, 0) ✓). Rank–nullity: image dimension 22 plus kernel dimension 11 equals 33 inputs.

Proofs & Why It Matters

Tip
Proof: the columns determine the map

Any x=x1e1+⋯+xnen\mathbf x = x_1\mathbf e_1 + \cdots + x_n\mathbf e_n, so by linearity T(x)=x1T(e1)+⋯+xnT(en)T(\mathbf x) = x_1T(\mathbf e_1) + \cdots + x_nT(\mathbf e_n) — a combination of the images of the basis vectors with weights given by the coordinates. Assembling T(ej)T(\mathbf e_j) as columns of a matrix AA makes this exactly AxA\mathbf x. Linearity leaves no freedom beyond the columns. ■\blacksquare

Tip
Proof: reflections have determinant −1

A reflection fixes a line and flips the perpendicular direction. In a basis adapted to those two directions its matrix is (100−1)\begin{pmatrix}1&0\\0&-1\end{pmatrix}, with determinant −1-1; changing basis conjugates the matrix, and det⁡(P−1MP)=det⁡M\det(P^{-1}MP) = \det M, so the determinant is −1-1 in every basis. Areas are preserved (∣−1∣=1|-1| = 1) but orientation reverses. ■\blacksquare

Going Deeper: Explanations & Worked Problems

Concept
A gallery of maps, with their matrices derived
rotate 30°det 1reflect y = xdet −1projectdet 0sheardet 1
The unit square (dashed) and its image under each map, with the arrow tracking e₁.

Derive, never memorize: a map's matrix has columns T(e1),T(e2)T(\mathbf e_1), T(\mathbf e_2). Rotation by θ\theta: e1=(1,0)\mathbf e_1 = (1,0) lands at (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta); e2=(0,1)\mathbf e_2 = (0,1) at (−sin⁡θ,cos⁡θ)(-\sin\theta, \cos\theta); hence Rθ=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)R_\theta = \begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}, det⁡=cos⁡2+sin⁡2=1\det = \cos^2 + \sin^2 = 1. Reflection across y=xy = x: the basis vectors swap, so (0110)\begin{pmatrix}0&1\\1&0\end{pmatrix}, det⁡=−1\det = -1. Projection onto the xx-axis: e1\mathbf e_1 stays, e2\mathbf e_2 dies: (1000)\begin{pmatrix}1&0\\0&0\end{pmatrix}, det⁡=0\det = 0 — information is destroyed, and indeed the kernel is the whole yy-axis. Shear: (1k01)\begin{pmatrix}1&k\\0&1\end{pmatrix} slides horizontals by their height, det⁡=1\det = 1 (areas survive shearing). The determinant column of this gallery — 1,−1,0,11, -1, 0, 1 — is a complete orientation-and-area story at a glance.

Why the two columns are enough: every vector is xe1+ye2x\mathbf e_1 + y\mathbf e_2, so linearity forces T(x,y)=x T(e1)+y T(e2)T(x, y) = x\,T(\mathbf e_1) + y\,T(\mathbf e_2) — which is exactly the matrix times (x,y)(x, y). Once you know where the two basis vectors land, nothing about the map is left to choose. Test it on the rotation with θ=90∘\theta = 90^\circ: the columns are (0,1)(0, 1) and (−1,0)(-1, 0), so (2,1)(2, 1) goes to 2(0,1)+1(−1,0)=(−1,2)2(0, 1) + 1(-1, 0) = (-1, 2) — the same length 5\sqrt5, and perpendicular to (2,1)(2, 1) because 2⋅(−1)+1⋅2=02\cdot(-1) + 1\cdot 2 = 0, just as a quarter turn should be.

Example
Worked: kernel and image of one map, completely

Let T(x,y,z)=(x+y, y+z)T(x, y, z) = (x + y,\ y + z), matrix (110011)\begin{pmatrix}1&1&0\\0&1&1\end{pmatrix}. Kernel: solve x+y=0x + y = 0, y+z=0y + z = 0: x=−yx = -y, z=−yz = -y, yy free — the line spanned by (−1,1,−1)(-1, 1, -1) (check: T(−1,1,−1)=(0,0)T(-1,1,-1) = (0, 0) ✓). Dimension 11.

Image: the span of the columns (1,0),(1,1),(0,1)(1,0), (1,1), (0,1); already the first two are independent, so the image is all of R2\mathbb R^2, dimension 22. Rank–nullity audit: 3=2+13 = 2 + 1 ✓. Interpretation: TT squashes three-dimensional space onto the plane, and the crushing happens exactly along the kernel line — every fiber T−1(b)T^{-1}(\mathbf b) is a translate of that line, which is the geometric meaning of "general solution = particular + homogeneous."

Example
Worked: composing transformations by multiplying matrices

What single map is "reflect across y=xy = x, then rotate 90∘90^\circ counterclockwise"?

Step 1 — matrices: reflection F=(0110)F = \begin{pmatrix}0&1\\1&0\end{pmatrix}, rotation R=(0−110)R = \begin{pmatrix}0&-1\\1&0\end{pmatrix}.

Step 2 — compose in the right order: the reflection acts first, so the product is RFRF (closest to the input acts first): RF=(0−110)(0110)=(−1001)RF = \begin{pmatrix}0&-1\\1&0\end{pmatrix}\begin{pmatrix}0&1\\1&0\end{pmatrix} = \begin{pmatrix}-1&0\\0&1\end{pmatrix} — reflection across the yy-axis.

Step 3 — the other order: FR=(100−1)FR = \begin{pmatrix}1&0\\0&-1\end{pmatrix}, reflection across the xx-axis: different, as expected.

Step 4 — determinant ledger: det⁡R⋅det⁡F=(1)(−1)=−1=det⁡(RF)\det R\cdot\det F = (1)(-1) = -1 = \det(RF) ✓ — a rotation composed with a reflection is always another reflection.

Formulas, Proofs & Tips

Tip
Rigid motions in the plane
(x,y)→(x+a, y+b),(x,y)→(x,−y),(x,y)→(−y,x) (90∘ CCW)(x,y)\to(x+a,\,y+b),\quad (x,y)\to(x,-y),\quad (x,y)\to(-y,x)\ (90^\circ\text{ CCW})

What it means. Translation, reflection in the xx-axis, and rotation about the origin.

Example. Reflecting (3,2)(3,2) over the xx-axis gives (3,−2)(3,-2).

Why it works. Rotating 90∘90^\circ counter-clockwise sends the direction "right" to "up" and "up" to "left", i.e. (1,0)→(0,1)(1,0)\to(0,1) and (0,1)→(−1,0)(0,1)\to(-1,0); applying that to (x,y)(x,y) gives (−y,x)(-y,x).

Tip. Rigid motions preserve lengths and angles, so the image is congruent. Only dilations change size.