Skip to content

Linear Transformations — The Deep Idea

The previous chapter gave you the mechanics of matrices: how to write them down, how to multiply them by vectors, how to compose and invert them. You can now operate a matrix like a carpenter operates a saw. This chapter explains what the saw actually is.

The central insight is almost absurdly elegant: a matrix is not just a grid of numbers — it is a complete description of how space itself gets warped. Every entry in the matrix is a quiet answer to the question, "where does this piece of space end up?" Once you see that, you will read matrices differently. The columns will stop looking like lists of numbers and start looking like arrows pointing to new destinations.

By the end of this chapter you will be able to:

  • State the two rules that make a transformation "linear" and explain why they matter.
  • Derive any transformation matrix by asking where the basis vectors land.
  • Visualize what different matrices do to the grid lines of space.
  • Explain, in one sentence, why some matrices cannot be inverted.
  • Read the Model-View-Projection pipeline as a chain of three linear transformations.

Imagine the Grid Itself Moving

Picture the entire 2D plane printed on a sheet of rubber graph paper. Every point in the plane lives on this paper: the origin at center, the -axis stretching left and right, the -axis stretching up and down. The grid lines are evenly spaced.

Now imagine grabbing the sheet and distorting it — stretching the right side, rotating the whole thing, squashing the top. The points on the paper move with it.

That is what a matrix does. It does not move individual points one by one; it moves the entire plane. Every vector, every polygon, every curve drawn on that rubber sheet gets carried along for the ride. The matrix is the recipe for how the sheet deforms.

But here is the key observation: not every deformation counts as a linear transformation. A linear deformation is one that keeps the grid lines straight and parallel, and that keeps the origin exactly where it is. If you stretch the sheet uniformly or rotate it, the grid lines stay straight. If you fold a corner over, they do not. Linearity is the precise rule separating these two cases.

What Makes a Transformation "Linear"?

A transformation is just a function that takes a vector as input and returns a vector as output.[^1] We write to mean "apply transformation to vector ."

A transformation is linear if it satisfies exactly two rules:[^1]

Rule 1 — Additivity:

Adding two vectors and then transforming the result is the same as transforming each vector separately and then adding.

Rule 2 — Scalar multiplication (homogeneity):

Scaling a vector and then transforming it is the same as transforming first and then scaling.

TIP

These two rules are often combined into a single statement: . In words: linear transformations play nicely with the two operations you care about most — addition and scalar multiplication.

What these rules prohibit. Think of an audio effect chain. A plain amplifier doubles the volume of every frequency equally: turn the gain up by 2 and the output doubles. That is homogeneous. Two signals fed through it separately and then mixed will sound identical to mixing them first and then amplifying. That is additive. The amplifier is linear.

A distortion pedal is different. It clips loud peaks, introduces harmonics that were not in the original signal. The output of two overlapping signals is not the sum of their individual outputs — the interaction creates new frequencies. That pedal is non-linear.

In geometry, non-linearity looks like this: a transformation that moves the origin (translation) violates both rules. Rule 2 alone forces . A linear transformation always maps the zero vector to itself. If the origin moves, the transformation is not linear.

WARNING

Translation is not a linear transformation. Moving every point two units to the right is a perfectly sensible and useful operation, but it is not linear — because the origin moves. This is why game engines use matrices in 3D instead of : the extra dimension (homogeneous coordinates) is a trick that turns translation into a linear operation in a higher-dimensional space. More on that in Chapter 9.

A quick check. Is the transformation linear?

Check Rule 1 at the zero vector: .

No — the origin moves. Not linear.

Is linear? Check:

Yes — this transformation is linear. And notice what it looks like: it stretches horizontally by 2 and flips vertically. Those are exactly the kinds of operations matrices are built to describe.

Basis Vectors — The Two Messengers

Here is the insight that unlocks everything. In 2D space, any vector can be written as a linear combination of just two special vectors:

These are the standard basis vectors — one unit step along the -axis, one unit step along the -axis.[^2] (Chapter 2 wrote these as and ; the notation is more common in linear algebra texts and generalises cleanly to dimensions.) For example, the vector is simply:

Any vector is . The components are just the coordinates — how many steps along each basis direction.

Now here is the elegant consequence. If is linear, then:

This is a consequence of the two rules applied together: the scalar multiples factor out (Rule 2) and the sum splits apart (Rule 1). The result is remarkable: to know a linear transformation completely, you only need to know where it sends the two basis vectors. Everything else follows by linearity.

Think of and as scouts. Send them out to explore the transformed space. Once they report back — "I landed here," "I landed there" — you can reconstruct exactly where any other vector ends up.

The Columns of a Matrix Are Landing Spots

Let and .

Then for any vector :

Write that in matrix form and you get:

The first column is where lands. The second column is where lands.

This is the deep idea. It is not a computational coincidence — it is the definition. The matrix of a linear transformation is constructed by stacking the images of the basis vectors as columns:[^1][^2]

Example: deriving the rotation matrix from scratch. Where does a 90° counterclockwise rotation send the basis vectors?

  • — the rightward unit vector. A 90° CCW rotation sends it to .
  • — the upward unit vector. A 90° CCW rotation sends it to .

Stack those as columns:

That is exactly the rotation matrix from Chapter 4 — derived purely from geometric reasoning, no trigonometry needed for this special case.

Example: deriving a reflection matrix. Reflect every point across the -axis (flip the -coordinate):

  • — it lies on the -axis, so it does not move.
  • — it flips below the axis.

You can now read any matrix as a pair of arrows: where does the right-pointing unit vector go, and where does the up-pointing unit vector go? The whole transformation is pinned down by those two answers.

The Grid-Paper View

This is the visual intuition referenced in the opening. Imagine the entire 2D plane as a grid of evenly spaced horizontal and vertical lines. Now apply a matrix. Each grid intersection is a vector, so the matrix moves all of them simultaneously.

The two rules of linearity guarantee:

  1. Grid lines stay straight (no curves, no kinks).
  2. Grid lines stay evenly spaced (no bunching up or spreading out unevenly).
  3. The origin stays put (the grid does not slide away).

Within these constraints, here is what different transformations look like:

Scale

Before               After S(2, 0.5)

+--+--+--+           +----+----+----+
|  |  |  |           |    |    |    |
+--+--+--+   -->     +----+----+----+
|  |  |  |           |    |    |    |
+--+--+--+           +----+----+----+

The grid stretches horizontally, compresses vertically. Lines stay straight and parallel.

Rotation

Before               After R(45°)

+--+--+--+             /  /  /
|  |  |  |   -->      /  /  /
+--+--+--+           /  /  /
|  |  |  |          /  /  /
+--+--+--+

The grid rotates as a rigid body. Angles between grid lines, distances between intersections — all preserved.

Shear

Before               After H_x(1)

+--+--+--+           /--/--/--/
|  |  |  |   -->    /  /  /  /
+--+--+--+         /--/--/--/
|  |  |  |        /  /  /  /
+--+--+--+       /--/--/--/

The vertical lines slant. Horizontal spacing is preserved; vertical lines now lean to the right. Grid lines are still straight and evenly spaced.

Projection / Collapse

Before               After projection onto x-axis

+--+--+--+
|  |  |  |   -->   --+--+--+--+--   (all rows stacked onto one line)
+--+--+--+
|  |  |  |
+--+--+--+

This is different in kind. The entire plane is flattened onto the -axis. All the rows of the grid collapse onto a single line. Infinitely many input points now map to the same output point. Information is destroyed.

The projection matrix that collapses space onto the -axis looks like this:

Check where the basis vectors go: (stays put), (collapses to the origin). The entire -dimension is destroyed.

INFO

The "grid lines stay straight and evenly spaced" test is a useful visual sanity check. If you apply a transformation and the grid curves, bunches up, or the origin moves, the transformation is not linear — and a matrix cannot represent it directly.

Invertibility — When Information Is Lost

We briefly encountered invertibility in Chapter 4: some matrices have an inverse, some do not. The grid-paper view makes the reason clear.

A transformation is invertible if you can uniquely undo it — if for every output vector, there is exactly one input vector that produced it.[^3] Geometrically: an invertible transformation bends the grid without ever collapsing two different points onto the same point.

The projection example above is the classic failure case. After projecting onto the -axis, every point maps to . The points and both map to . You cannot tell them apart from their output. No inverse can exist, because "undo " has no unique answer.

The Null Space

The set of all vectors that a transformation sends to is called the null space (or kernel) of the transformation.[^4] For the projection matrix above:

Every vector of the form maps to the origin — the entire -axis is the null space.

For an invertible transformation, the null space contains only the zero vector. If anything other than maps to , the transformation is lossy, and no inverse can recover what was discarded.[^4]

Rank — How Many Dimensions Survive

The rank of a transformation is the number of dimensions in its output. A transformation from 2D to 2D has full rank (rank 2) if it fills all of 2D with its outputs. If it collapses everything onto a line, it has rank 1. If it sends every vector to , it has rank 0.[^4]

For the projection matrix :

Every output lies on the -axis — a 1-dimensional subspace. Rank = 1.

INFO

Rank and null space are complementary. In the projection example, rank 1 means one dimension is preserved; the other dimension collapses into the null space. The precise relationship — rank + nullity = number of input dimensions — is the rank-nullity theorem, which Chapter 6 develops in full with a worked example.

The rule for invertibility is clean: a square matrix is invertible if and only if it has full rank — meaning its transformation does not collapse any dimension.[^3] Chapter 4 previewed this idea through the inverse formula: the quantity (the determinant) appears in the denominator, so a zero value means no inverse exists. Chapter 7 develops the determinant fully and proves the connection rigorously. Both are ways of asking the same question: does the transformation destroy information?

Three equivalent statements

For a square matrix , the following are all the same thing:

  • is invertible.
  • The null space of contains only .
  • has full rank.
  • The determinant of is non-zero (Chapter 7 will prove this in detail).
  • The columns of are linearly independent (Chapter 6 will define this precisely).

These are not five separate facts to memorize — they are five views of one underlying truth: an invertible transformation preserves all information.

The MVP Pipeline — A Chain of Linear Transformations

With this understanding in hand, game graphics become legible. The Model-View-Projection (MVP) pipeline is the sequence of transformations every vertex passes through when a 3D scene is rendered to a 2D screen.[^5]

Each matrix is a linear transformation:

  • (Model matrix): Moves a vertex from the object's local coordinate system into the shared world coordinate system. This encodes the object's position, rotation, and scale in the world. Apply first (rightmost = first applied).

  • (View matrix): Moves the world so that the camera is at the origin, looking down the axis. This is the inverse of the camera's own transform — to simulate a camera moving right, you shift the entire world left.[^5]

  • (Projection matrix): Flattens the 3D camera-space scene onto 2D clip coordinates, incorporating perspective (objects far away appear smaller). This is the one step in the pipeline that is deliberately rank-reducing — 3D space maps to a 2D surface.

The beauty is the composition: multiply once per frame (or even per object), and then apply that combined matrix to every single vertex in the mesh. You are not chaining three transformations per vertex — you collapse them into one. This is exactly what Chapter 4's matrix-matrix multiplication was building toward.

TIP

When debugging a 3D rendering issue, think about which stage of the pipeline is the culprit. Is the object in the wrong position? Suspect . Is the camera at a strange angle? Suspect . Is the perspective distorted? Suspect . Each matrix is one linear transformation with a clear, auditable job.

Chapter Recap

Here is the core loop that now runs through your head every time you see a matrix:

  1. A matrix encodes a linear transformation — a warping of space that keeps grid lines straight, keeps them evenly spaced, and keeps the origin fixed.

  2. The columns are the landing spots for the standard basis vectors. Read the first column: "this is where the rightward unit vector ends up." Read the second column: "this is where the upward unit vector ends up." The rest follows by linearity.

  3. Invertible = no information lost. A transformation is invertible if and only if it does not collapse any dimension. The null space contains only , the rank is full, and you can uniquely undo every output.

  4. Composition is powerful. Chaining linear transformations means multiplying their matrices. The MVP pipeline turns three sequential spatial moves into a single matrix applied millions of times per frame.

The next chapter puts these ideas to work in a different direction: given a matrix and a result vector , can you find the input vector such that ? That is the problem of solving a system of linear equations — and everything you just learned about rank and null spaces will determine whether a solution exists.

References

[^1]: Margalit, D. and Rabinoff, J. "Linear Transformations." Interactive Linear Algebra, Georgia Tech / LibreTexts. https://textbooks.math.gatech.edu/ila/linear-transformations.html

[^2]: Kuttler, K. "The Matrix of a Linear Transformation I." A First Course in Linear Algebra, LibreTexts, §5.2. https://math.libretexts.org/Bookshelves/Linear_Algebra/A_First_Course_in_Linear_Algebra_(Kuttler)/05:_Linear_Transformations/5.02:_The_Matrix_of_a_Linear_Transformation_I

[^3]: "The Column Space and Nullspace of a Linear Transformation." Department of Mathematics, University of Texas at San Antonio. https://mathresearch.utsa.edu/wiki/index.php?title=The_Column_Space_and_Nullspace_of_a_Linear_Transformation

[^4]: "Kernel (linear algebra)." Wikipedia. https://en.wikipedia.org/wiki/Kernel_(linear_algebra)

[^5]: Santell, J. "Model View Projection." jsantell.com. https://jsantell.com/model-view-projection/