Matrix Transforms — How Space Bends

How 2×2 matrices rotate, scale, and reshape space itself

Mathematics Linear Algebra intermediate 7 min

This concept builds on Vectors — Direction and Magnitude, Sine on the Unit Circle and in a Right Triangle, Cosine — The Other Side. Consider exploring them first for the best experience.

Step 1 of 6

The Identity Matrix

Start with [[1, 0], [0, 1]]. The blue î and green ĵ arrows sit on the axes and the purple square matches its dashed ghost. Drag anywhere on the plane to move the orange input vector v: the pink image M·v lands exactly on top of it, because the identity is the "do nothing" transform every other matrix is measured against.

Scaling Matrix

Move the 'Scale factor s' slider to build [[s, 0], [0, s]]. Every point moves s times farther from the origin: the square grows, and the pink M·v arrow stretches along the same line as v. The "Area scale" card reads s squared, because both sides grow. Values below 1 shrink space; values above 1 stretch it.

Rotation Matrix

Move the 'Rotation θ (degrees)' slider. The matrix [[cos θ, −sin θ], [sin θ, cos θ]] turns every point by θ around the origin, and the cos θ and sin θ cards show its entries. Watch the blue î arrow: its tip is the first column, (cos θ, sin θ). Columns are destinations — they tell you where each axis lands.

Composing Transforms

Choose a rotation and a scale together and the canvas shows both at once, while the formula box multiplies them into one matrix. Matrix multiplication chains transforms: the rightmost matrix is applied first, the leftmost last. Rotating then scaling equals scaling then rotating here only because the scale is uniform — with a stretch or a shear, order matters.

Shear and General Transforms

Press 'Build Your Own Matrix' and move the 'b (row 1, col 2)' slider away from 0 while a = d = 1: the square shears into a parallelogram instead of turning. Then press 'Reflect' — the "Orientation" card reads Flipped, because a negative determinant means the shape comes out mirror-imaged, like a reflection.

Worked Example: Stretching (1, 1) by [[2, 0], [0, 1]]

Press 'Build Your Own Matrix', then press 'Stretch x' to load [[2, 0], [0, 1]], and drag v to (1, 1). Across: 2·1 + 0·1 = 2. Up: 0·1 + 1·1 = 1. So the "Image M·v" card reads (2, 1) — one copy of the first column (2, 0) plus one of the second (0, 1). The determinant is 2·1 − 0·0 = 2, so the "Area scale" card reads 2.00×: every area doubles.

How It Works — Step by Step

Step 1 of 6
  1. 1

    The Identity Matrix

    Start with [[1, 0], [0, 1]]. The blue î and green ĵ arrows sit on the axes and the purple square matches its dashed ghost. Drag anywhere on the plane to move the orange input vector v: the pink image M·v lands exactly on top of it, because the identity is the "do nothing" transform every other matrix is measured against.

  2. 2

    Scaling Matrix

    Move the 'Scale factor s' slider to build [[s, 0], [0, s]]. Every point moves s times farther from the origin: the square grows, and the pink M·v arrow stretches along the same line as v. The "Area scale" card reads s squared, because both sides grow. Values below 1 shrink space; values above 1 stretch it.

  3. 3

    Rotation Matrix

    Move the 'Rotation θ (degrees)' slider. The matrix [[cos θ, −sin θ], [sin θ, cos θ]] turns every point by θ around the origin, and the cos θ and sin θ cards show its entries. Watch the blue î arrow: its tip is the first column, (cos θ, sin θ). Columns are destinations — they tell you where each axis lands.

  4. 4

    Composing Transforms

    Choose a rotation and a scale together and the canvas shows both at once, while the formula box multiplies them into one matrix. Matrix multiplication chains transforms: the rightmost matrix is applied first, the leftmost last. Rotating then scaling equals scaling then rotating here only because the scale is uniform — with a stretch or a shear, order matters.

  5. 5

    Shear and General Transforms

    Press 'Build Your Own Matrix' and move the 'b (row 1, col 2)' slider away from 0 while a = d = 1: the square shears into a parallelogram instead of turning. Then press 'Reflect' — the "Orientation" card reads Flipped, because a negative determinant means the shape comes out mirror-imaged, like a reflection.

  6. 6

    Worked Example: Stretching (1, 1) by [[2, 0], [0, 1]]

    Press 'Build Your Own Matrix', then press 'Stretch x' to load [[2, 0], [0, 1]], and drag v to (1, 1). Across: 2·1 + 0·1 = 2. Up: 0·1 + 1·1 = 1. So the "Image M·v" card reads (2, 1) — one copy of the first column (2, 0) plus one of the second (0, 1). The determinant is 2·1 − 0·0 = 2, so the "Area scale" card reads 2.00×: every area doubles.

Key Takeaways

Columns Are Destinations

The first column of a 2×2 matrix is where [1, 0] (the x-axis) lands. The second column is where [0, 1] (the y-axis) lands. Read the columns to instantly understand any linear transform.

Rotation Needs Two Functions

cos θ and sin θ appear in every rotation matrix because rotating a unit vector by θ produces (cos θ, sin θ) — the very definition of sine and cosine.

Order Matters

Matrix multiplication is not commutative: rotate then scale ≠ scale then rotate (in general). When composing transforms, the order in which you multiply matrices determines the result.

Follow One Vector

The image of (x, y) is x copies of the first column plus y copies of the second. [[2, 0], [0, 1]] sends (1, 1) to (2, 0) + (0, 1) = (2, 1), and its determinant 2 says every area doubles.

Added
Updated
  • — Drag an input vector to see its image under the matrix, plus a worked example and a new quiz question.