Home / Linear Algebra

A Matrix is a Transformation

Drag the four numbers and watch space itself rotate, stretch and shear. The columns of the matrix are simply where the two basis vectors land.

The Matrix

1.0
1.0
0.0
1.0

1.00

0 = untouched, 1 = fully transformed

Space, Transformed

det = 1.00

Green is where the first basis vector lands, blue the second. The shaded patch was the unit square.

What It Does

Determinant
1.00
signed area of the unit square
Area Scale 1.00×
Orientation kept
Rank 2
Invertible? yes

Where the Basis Lands

î = (1, 0) →
(1.0, 0.0)
ĵ = (0, 1) →
(0.0, 1.0)

These are exactly the two columns of the matrix. That is the whole trick: a matrix is a record of where the basis vectors go, and everything else follows.

A Matrix is a Transformation: A Practical Guide

The one idea that turns linear algebra from bookkeeping into geometry.

Quick Context

Most people first meet a matrix as a grid of numbers with rules for multiplying it. The rules work, but they explain nothing, and matrix multiplication in particular looks arbitrary — why rows against columns, and why in that order?

There is a single reframing that makes all of it obvious: a matrix is a function that moves space. Every entry, every rule, and every quantity derived from it is a statement about how space got moved.

The columns are the whole story

Start with the two basis vectors: î = (1, 0) pointing along x, and ĵ = (0, 1) pointing along y. Every vector is built from them — (3, 2) means "3 of î plus 2 of ĵ".

A linear transformation is one that keeps the grid lines straight, evenly spaced, and the origin fixed. That constraint has a consequence: if you know where î and ĵ land, you know where everything lands, because (3, 2) must still be "3 of the new î plus 2 of the new ĵ".

So a transformation only needs to record two vectors. Write them as columns and you have the matrix:

[ a   b ]    first column (a, c) = where î lands
[ c   d ]    second column (b, d) = where ĵ lands

Check it against the panel on the right while you drag the sliders. The two readouts are always exactly the two columns, because that is what the columns are.

Why matrix-vector multiplication looks like that

Now the formula stops being arbitrary. To transform (x, y), take x copies of where î went and y copies of where ĵ went, and add:

M(x, y) = x·(a, c) + y·(b, d) = (ax + by, cx + dy)

That is the rule you were taught, derived rather than memorised. And matrix multiplication is just doing this twice — applying one transformation and then another — which is also why order matters: rotating then shearing is genuinely not the same as shearing then rotating.

Interactive Exploration Guide

  1. Start with nothing. Set the Preset to Identity. The grid does not move, the determinant is 1, and the columns are (1,0) and (0,1) — the basis vectors, unmoved.
  2. Confirm the columns claim. Set Entry a to 2 and Entry c to 1. The green vector jumps to (2, 1), which is the first column exactly. Drag any slider and watch the two readouts track the four numbers.
  3. Watch it happen. Click Animate the Transform and watch space slide continuously from untouched to fully transformed. The grid lines stay straight and evenly spaced the whole way — that is what makes it linear.
  4. Double the area. Set the Preset to Scale by 2. Every length doubles, so area quadruples, and the determinant reads exactly 4.
  5. Rotate without distorting. Set the Preset to Rotate 45°. The determinant is 1 — rotation moves everything but stretches nothing, so area is untouched.
  6. Flip it over. Set the Preset to Reflect in the y-axis. The determinant goes to −1. The magnitude is still 1, because no area was gained or lost, but the sign flipped: space was turned over.
  7. Destroy a dimension. Set the Preset to Squash flat. The determinant hits 0, the grid collapses onto a single line, rank drops to 1, and Invertible reads no. Once two dimensions have been flattened into one, no transformation can pull them apart again — the information is gone.

The determinant, in one sentence

The unit square has area 1. Apply the matrix and it becomes a parallelogram. The determinant is that parallelogram's area, with a sign telling you whether space was flipped.

  • det = 1 — area preserved. Rotations and shears.
  • det = 3 — everything triples in area.
  • det = −1 — area preserved but orientation reversed, like looking in a mirror.
  • det = 0 — space collapsed to a line or a point. Nothing can undo it, which is precisely why a zero determinant means no inverse exists.

The formula ad − bc is not a magic incantation; it is the area of the parallelogram spanned by the two columns.

Where this shows up

  • A neural network layer is a matrix followed by a non-linearity. The matrix moves space; the activation is what bends it, which is why stacking matrices alone buys nothing.
  • PCA looks for the directions along which a transformation stretches most — which is exactly what eigenvectors describe.
  • Rotation matrices in graphics and robotics are chosen precisely because their determinant is 1: they move objects without resizing them.

What usually goes wrong

  • Reading the rows as the basis images. It is the columns. A very common slip, and it transposes every result.
  • Assuming multiplication commutes. AB and BA are different transformations applied in different orders and generally give different answers.
  • Ignoring a near-zero determinant. Not quite singular is often worse than singular: the inverse exists but is enormous, and small input errors get amplified. This is what "ill-conditioned" means.
  • Expecting the determinant to measure size. A matrix can stretch enormously in one direction and squash in another and still have determinant 1. It measures area, not magnitude.

Key Takeaway

A matrix is a record of where the basis vectors land, stored as its columns, and because linear transformations keep grid lines straight and evenly spaced that record determines where every other vector goes. This makes the multiplication rule a derivation rather than a convention: transforming (x, y) means taking x copies of the first column plus y copies of the second. The determinant is the area of the transformed unit square, signed by whether space was flipped, so a determinant of zero means space collapsed onto a line and no inverse can exist.

Predict, then reveal

About to run: Confirm the columns claim. Before it does — what happens to the readout?

Committing to an answer first is the point — the reveal runs the experiment on the visualisation above and reads the real value back, so nothing here is scripted.

Recall check

0 of 3

Say the answer out loud before you reveal it — recalling it is what makes it stick, and rereading it is not.

  1. Without scrolling back — what is the one-line takeaway from this module?

  2. What does this module say about “Quick Context”?

  3. What does this module say about “The columns are the whole story”?

Cheat sheet

A Matrix is a Transformation

These are exactly the two columns of the matrix. That is the whole trick: a matrix is a record of where the basis vectors go, and everything else follows.

MATHS · vizlearn.in/maths/matrix_as_transformation.html