Drag the two arrows. Everything is here.
Two draggable arrows. The faint grid behind them is 2D space, transformed live. The filled shape is the unit square (the unit-corner box at the origin) under the same transformation.
Quests, in order:
- Press I. Nothing moves. The arrows sit at and . This is “do nothing.”
- Press rot 90°. The whole space turns ninety degrees. Notice both arrows turned together.
- Press shear. The grid tilts. One arrow stayed put; the other slid sideways.
- Press collapse. The unit square flattens to a line. Space lost a dimension.
- Drag column 1 across the origin. The shape’s fill flips: orientation reversed.
You just wrote down five matrices without seeing a single number. That’s the point of the lesson.
What you just discovered.
Every transformation you ran is fully described by two arrows: wherever the two columns ended up.
That pair of arrows is the matrix. The first column tells you where the arrow landed (we’ll call it , “i-hat”). The second column tells you where landed (, “j-hat”).
That’s the entire object. A matrix isn’t a 4-number grid you memorize formulas about. It’s a record of where two arrows landed, and every other fact about it is downstream of those two arrows.
Read off a matrix.
Suppose a transformation sends and .
Write it as a 2×2 matrix. What’s the entry at row 2, column 2?
Linearity, after the fact.
Two things you might have noticed while playing, both of which turn out to be the definition of what makes a transformation “linear.”
The origin always stays put. No preset moves the corner of the unit square that sits at . You can’t translate space with a linear transformation; only the directions of the arrows change.
Grid lines stay straight, evenly spaced. Rotate, shear, scale, collapse: the grid’s spacing may change, but the lines themselves stay lines. Nothing bends.
Both rules together are the formal definition: a transformation is linear if, for all vectors and scalars :
You were obeying both axioms with your fingers the whole time. The axioms are the bookkeeping; the widget is the thing.
(Aside: the function from precalc is not linear in this sense when ; it shifts the origin. It’s affine, meaning linear plus a translation. Mathematicians are picky about this; ML people use “linear layer” to mean “affine layer” all the time, and we just live with it.)
Multiplying by a vector: the column picture.
You know the matrix is two columns. Now: what does actually mean?
If , then is ” steps along , then steps along .” After the transformation, and have moved; they’re now the columns of . Linearity means the recipe survives: take the same steps along the new , then steps along the new .
where are the columns. Matrix-vector multiplication is a weighted sum of the columns. That’s the whole geometric meaning. Read as “blend the columns of in proportions given by .”
Blend two columns.
For and :
Blend of column 1 with of column 2. What’s the first component of the result?
The row picture: a faster way to compute the same thing.
Same answer, different bookkeeping. If you only want the -th output component, you can dot the -th row of with :
This is the formula every textbook leads with. It’s faster to compute by hand and it gives the same answer. But it hides the geometry behind arithmetic; you wouldn’t have learned anything new about matrices from staring at it.
The move: column picture for thinking, row picture for computing. When you’re trying to understand what a matrix does, blend the columns. When you’re trying to compute the answer, dot the rows.
Name the matrices you already built.
Reopen the widget if you want. Each preset has a name and a formula. You don’t memorize these; you draw the transformation, read off the columns, write them down.
- Identity (): stays at , stays at . Matrix: .
- Scale by : both arrows triple in length. Matrix: .
- Rotation by : moves to . Matrix: .
- Horizontal shear: stays put; slides to . Matrix: .
- Reflection across the -axis: flips down to . Matrix: .
Try this in the widget: drag the columns to make a counterclockwise rotation by hand. goes to . goes to . That’s it. That’s the whole matrix.
Rotation by inspection.
Without computing anything: the matrix that rotates every vector counterclockwise.
What’s the entry at row 1, column 2?
Collapse: what it looks like to lose a dimension.
Reopen the widget and press collapse again. The two columns end up parallel; the unit square is squashed flat into a line. Whatever was 2D before is now 1D.
When the columns of a matrix span only a line (or a point), the matrix has rank less than 2. Specifically:
- Both columns linearly independent → rank 2, full rank, the transformation reaches every direction.
- Columns parallel (one is a scalar multiple of the other) → rank 1, the transformation flattens 2D space to a line.
- Both columns are the zero arrow → rank 0, everything goes to the origin.
Rank measures how much space the transformation can reach. Losing rank is the geometric event behind every “this matrix is singular” / “this system has no unique solution” warning you’ll meet for the rest of linear algebra.
Drag the two columns until they’re nearly aligned. Watch the det readout drop toward zero. Determinant is rank’s continuous cousin; we’ll meet it formally next lesson, but you’ve already seen it move.
Lesson complete