Linear Algebra

It's Just Scaling

A visual essay on linear algebra, from grid transformations to eigenvectors

Previously: It's Just Zooming In — a visual essay on calculus

A photograph is 800,000 colored dots. To rotate it 30 degrees, you need exactly two numbers.

That sounds impossible. Every single pixel has to move to a new location — 800,000 tiny relocations, each to a precise coordinate. And yet the entire operation is controlled by a 2×2 grid of numbers: a matrix.

$$\begin{pmatrix} \cos 30° & -\sin 30° \\ \sin 30° & \cos 30° \end{pmatrix} = \begin{pmatrix} 0.866 & -0.5 \\ 0.5 & 0.866 \end{pmatrix}$$

Four numbers. Two of them are the same (0.866 and 0.5), just rearranged with a sign flip. So really, two numbers encode a rotation of any image of any size.

How? What is a matrix actually doing to all of space when it transforms it? And once you understand that, here is the deeper question: is there a way to see every matrix — rotations, stretches, shears, projections — as doing the same fundamental thing?

That question has an answer so clean it will feel like a punchline. But to get there, we need to understand what a matrix acts on in the first place.


1

Arrows, Not Numbers #

A ship sails northeast at 20 knots. A current pushes it due south at 5 knots. Where does the ship end up?

You cannot answer this with a single number. You need two pieces of information that each have a direction — and then you need to combine them. This is a problem that demands something richer than plain numbers.

That richer thing is a vector: a quantity with both magnitude and direction. On paper, we draw it as an arrow. A plain number — a scalar — only tells you "how much." A vector tells you "how much" and "which way."

In two dimensions, every vector can be described by two coordinates: how far right and how far up. The vector $(3, 2)$ means "go 3 units right and 2 units up." But coordinates are not the vector itself — they are a description that depends on your choice of reference directions.

Drag the arrow below to feel this. The arrow is the real object. The coordinates are just a way to talk about it.

Vector: (3.0, 2.0)

Drag the arrow tip. The coordinates update, but they are just describing the same geometric object.

Notice something: no matter where the arrow points, it is always described by exactly two numbers. Two dimensions, two coordinates. That is not a coincidence — it is the whole point. A 2D vector lives in a space where two numbers are enough to pin down any direction and magnitude.

But what can you do with these arrows?


2

Scaling and Adding #

Stretching an arrow by a number — say, multiplying vector $\mathbf{v}$ by 2 — doubles its length without changing its direction. Multiplying by $-1$ flips it around. Multiplying by $0.5$ shrinks it to half length. This is scalar multiplication.

Combining two arrows means placing them tip-to-tail: start where the first one ends and draw the second. The result is a new arrow from the very start to the very end. This is vector addition.

Use the sliders below to scale two vectors, then see their sum. Watch how the parallelogram forms — the sum is always the diagonal.

Scale v: 1.0
Scale ŵ: 1.0

The sum (dashed) is the diagonal of the parallelogram formed by the two scaled vectors.

These two operations — scaling and adding — are the only ones that matter. Every concept in linear algebra is built from just these two moves. A "linear combination" of vectors is nothing more than scaling each one by some number, then adding the results together.

$$a\mathbf{v} + b\mathbf{w}$$

Scale $\mathbf{v}$ by $a$, scale $\mathbf{w}$ by $b$, add. That is a linear combination. And it turns out that with the right choice of two arrows, you can reach any point in the plane this way.

You can stretch an arrow. You can combine two arrows. That is all of linear algebra.

But does which two arrows you start with matter? What if you chose two different arrows entirely?


3

Two Special Arrows #

In the interactive above, those two arrows could reach any point in the plane. Play with the sliders long enough and you will believe it: any combination of scalings reaches anywhere.

But there is a natural, obvious choice for those two starting arrows. Look at the grid itself. One arrow points one unit to the right. The other points one unit up. These are the basis vectors — the two arrows the grid is built from.

Mathematicians call them $\hat{\mathbf{i}}$ and $\hat{\mathbf{j}}$ (the hat means "unit length"). So $\hat{\mathbf{i}} = (1, 0)$ and $\hat{\mathbf{j}} = (0, 1)$. Any vector $(x, y)$ is the same thing as $x\hat{\mathbf{i}} + y\hat{\mathbf{j}}$. The coordinates literally tell you how much of each basis vector to use. The point $(3, 2)$ is 3 units of $\hat{\mathbf{i}}$ plus 2 units of $\hat{\mathbf{j}}$.

This fact is the key to understanding matrices. If I tell you where $\hat{\mathbf{i}}$ and $\hat{\mathbf{j}}$ land after a transformation, you know where everything lands. Because every vector is just a combination of $\hat{\mathbf{i}}$ and $\hat{\mathbf{j}}$, and the transformation preserves the scaling-and-adding recipe.

That is worth pausing on. Try it yourself.

The basis vectors $\hat{\mathbf{i}}$ and $\hat{\mathbf{j}}$ are about to be transformed. $\hat{\mathbf{i}}$ will land at $(2, 1)$ and $\hat{\mathbf{j}}$ will land at $(1, 3)$. Where will the point $(1, 1)$ land?

$(1, 1) = 1 \cdot \hat{\mathbf{i}} + 1 \cdot \hat{\mathbf{j}}$. After the transformation, $\hat{\mathbf{i}}$ lands at $(2, 1)$ and $\hat{\mathbf{j}}$ at $(1, 3)$. So the point lands at $(2, 1) + (1, 3) = (3, 4)$. The transformation of any point is just the same linear combination of the new basis vectors.

The point $(1,1) = 1\hat{\mathbf{i}} + 1\hat{\mathbf{j}}$ follows the same recipe after the transformation: it lands at $1 \cdot (2,1) + 1 \cdot (1,3) = (3,4)$.

This is why matrices work. A 2×2 matrix is just two columns — and each column tells you where one basis vector lands. The first column is the new $\hat{\mathbf{i}}$, the second column is the new $\hat{\mathbf{j}}$.

$$\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix}$$

This matrix says: "$\hat{\mathbf{i}}$ goes to $(2,1)$, $\hat{\mathbf{j}}$ goes to $(1,3)$." Once you know that, you know what happens to every single point in the plane.

A matrix is not a grid of numbers. It is a transformation of space, encoded as a pair of instructions.

But what does it look like when you actually apply one to space?


4

What Matrices Actually Do #

A matrix is a verb, not a noun. It moves space.

Edit the four entries below and watch the grid respond. Every 2×2 matrix defines a different transformation: rotations, reflections, shears, squashes. They all emerge from four numbers.

[
]
Try:

Every transformation of the plane is encoded in four numbers. The grid shows the original (gray) and transformed (red) coordinate system.

Play with this for a moment. Try the rotation preset — lines stay parallel, the grid rotates rigidly. Try the shear — the grid tilts, but horizontal lines stay horizontal. Try the projection — the entire 2D plane collapses onto a line.

All of these come from one operation: take every point $(x, y)$, compute $x$ times the first column plus $y$ times the second column. Scaling and adding. That is all a matrix does.

But some of these transformations destroy something, and we need a way to measure what.


5

When Scaling Collapses a Dimension #

Watch the shaded unit square in the grid below. It represents one unit of area in the original space. As you change the matrix, the square deforms into a parallelogram — and its area changes.

The determinant of a matrix is exactly this: how much the transformation scales area.

[
]
Determinant: 2.0 Area doubles
Try:

The shaded region shows what happens to one unit of area. The determinant is $ad - bc$.

Three cases tell the whole story:

  • det > 0: Area scales by the determinant. Orientation is preserved.
  • det < 0: Area scales by $|\text{det}|$, but orientation flips — like looking in a mirror.
  • det = 0: Area goes to zero. The plane collapses onto a line (or a point). A dimension is destroyed.

That last case is the important one. When the determinant is zero, the transformation is not reversible. You cannot unflatten a pancake. Information is permanently lost.

Try setting the determinant to zero above. Watch the parallelogram collapse to a line. Every point in 2D gets mapped to a point on that line. An entire dimension of information — gone.

So the determinant measures something deep about a transformation: whether it preserves, flips, or destroys the structure of space. But there is something even deeper hiding inside every matrix — special directions that survive the transformation unchanged.


6

The Directions That Just Scale #

In the chaos of a transformation reshaping all of space, some arrows just sit there.

Most vectors, when you apply a matrix, change both their direction and their length. They get rotated, sheared, squished. But some special vectors only get scaled — they point in the same direction (or exactly opposite), just stretched or shrunk.

Can you find them? Below is a transformed grid. Click on different directions to test them. When you find a direction that only scales — no rotation — you have found one of these special vectors.

The matrix $\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}$ transforms the grid below. Click on vectors to find the directions that only get scaled — not rotated. Find both eigenvectors.

Found: 0 / 2

Tap directions on the grid to test them.

Eigenvectors are the directions the matrix treats simply — just scaling, no rotation. The eigenvalue tells you the scale factor.

There is a tidy way to write what you just discovered. If the matrix $A$ acts on a vector $\mathbf{v}$ and the result is just $\lambda$ times $\mathbf{v}$ — same direction, different length — we write:

$$A\mathbf{v} = \lambda\mathbf{v}$$

These special vectors are the eigenvectors of the matrix, and the scaling factor $\lambda$ (lambda) is the eigenvalue.

For the matrix $\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}$, the eigenvectors point along $(1, 0)$ with eigenvalue 2, and along $(1, 1)$ with eigenvalue 3. Along those two directions, the transformation is pure scaling. Every other direction gets distorted.

This is not a curiosity. It is the key to the whole subject. If you can find the directions that only scale, you can understand any transformation as a sequence of simple scalings.

And that brings us to the payoff.


7

Every Transformation Is Just Scaling #

Here is the central insight of linear algebra, and the reason this essay is called what it is. Watch what happens when we decompose a transformation into its simplest parts.

Any diagonalizable matrix = change basis, scale, change back. The transformation IS scaling — from the right point of view.

Not every matrix can be decomposed this way. Some matrices — called defective matrices — do not have enough independent eigenvectors to form the change-of-basis matrix $P$. The classic example is $\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}$, which collapses everything onto one line with only one eigenvector direction. These cases require a more general decomposition (the Jordan form). But for the vast majority of matrices you will encounter — and all symmetric matrices — eigendecomposition works perfectly.

Did you catch it? In the middle step, the transformation is just... scaling. Along two axes. That is all it does.

The three steps are:

  1. Change basis to the eigenvector basis — look at the transformation from the eigenvectors' point of view.
  2. Scale along each eigenvector axis by its eigenvalue.
  3. Change back to the original basis.

In symbols: $A = PDP^{-1}$, where $P$ is the matrix of eigenvectors and $D$ is a diagonal matrix of eigenvalues. The diagonal matrix is the pure scaling. The $P$ and $P^{-1}$ are just the change of perspective.

This is the moment it all clicks. The complicated-looking matrix — the one that shears and stretches space in confusing ways — is secretly just scaling along two directions. All the apparent complexity was a consequence of looking at it from the wrong angle.

Linear algebra is just scaling. You only need to find the right directions.


The Door That Opens #

Let's go back to where we started. A rotation matrix:

$$\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$$

Let's try to find a direction that just scales under a 90-degree rotation. Point right — it rotates up. Point up — it rotates left. Point in any diagonal — it swings to a different diagonal. Every single direction turns. Not a single arrow in the plane survives with its direction intact.

So does our thesis fail? Have we been building toward a punchline that only works for convenient examples?

No. Apply $A\mathbf{v} = \lambda\mathbf{v}$ to the 90-degree rotation and you do find eigenvalues: they are $i$ and $-i$. Complex numbers. The directions that "just scale" exist, but they live in a space we cannot draw on this page. They require vectors with complex entries — arrows in a plane our pencils cannot reach.

This is the honest boundary, and it is a beautiful one. "Everything is just scaling" holds perfectly for many transformations. For rotations, it holds too — but only once you extend the number system to include $i = \sqrt{-1}$. The framework does not break. It demands a bigger room.

Where does this lead? Consider this: in 1998, Larry Page and Sergey Brin had a problem. The web was a billion pages linked to each other, and they needed to decide which ones mattered. They wrote the entire web as a matrix — each link a nonzero entry — and asked: what is the eigenvector? The direction that just scales when you apply the web's link structure, over and over, until it settles? That dominant eigenvector became PageRank, and it built Google.

The same idea appears everywhere. Image compression uses the Singular Value Decomposition — a generalization of eigendecomposition — to approximate millions of pixels with a handful of scaled directions. The natural vibration modes of a bridge, a guitar string, a molecule are the eigenvectors of the system's stiffness matrix; the frequencies are the eigenvalues.

Probability counted outcomes. Statistics averaged them. Calculus zoomed in to see rates of change. Trigonometry compared ratios on circles. Linear algebra scales all of these — in higher dimensions.

The question was never "what is a matrix?" The question was "what is a matrix doing?" And the answer, once you find the right directions, is always the same: it is just scaling.