Matrices: Grids of Numbers
A matrix is just a rectangular grid of numbers. But these grids can do some amazing things — they can rotate shapes, stretch them, flip them, and even describe systems of equations. Let’s start simple and build up.
Part 1: What Is a Matrix?
A matrix is written inside brackets. Here’s a 2x2 matrix (2 rows, 2 columns):
Each number in the grid is called an entry. The entries in a 2x2 matrix can transform points on a plane — that’s where things get really interesting.
Part 2: Matrix Transformations
A 2x2 matrix can transform the point (x, y) into a new point (x’, y’) using this rule:
Let’s see this in action. Use the sliders to set the four entries of a 2x2 matrix, and we’ll watch how it transforms the point (1, 0) and (0, 1):
The matrix maps the basis vectors to new positions. Let’s plot what happens to the line y = x under this transformation. The matrix maps each point (t, t) to a new location:
Try these famous transformations:
- Identity: a=1, b=0, c=0, d=1 — nothing changes!
- Scale by 2: a=2, b=0, c=0, d=2 — everything doubles
- Reflect over x-axis: a=1, b=0, c=0, d=-1
- Rotate 90 degrees: a=0, b=-1, c=1, d=0
- Shear: a=1, b=1, c=0, d=1 — slants everything sideways
Part 3: Scaling
When the matrix is diagonal (b = 0 and c = 0), it simply scales:
- Scale X = 2: stretches horizontally
- Scale Y = 2: stretches vertically
- Negative values: flip across that axis
The identity matrix is the scaling matrix with both scales = 1. It’s the matrix equivalent of multiplying by 1 — it does nothing. Every matrix has this “do nothing” partner.
Part 4: Rotation
A rotation by angle theta uses this matrix:
Watch the rotation:
- At theta = 0, the line doesn’t move
- At theta = pi/4 (about 0.785), the line becomes vertical
- At theta = pi/2 (about 1.571), y = x maps to y = -x
- At theta = pi (about 3.14), everything rotates 180 degrees
Part 5: The Determinant — Does the Matrix Squish or Stretch?
The determinant of a 2x2 matrix tells you how much the matrix changes areas:
- |det| > 1: Areas expand
- |det| = 1: Areas stay the same (rotations and reflections)
- |det| < 1: Areas shrink
- det = 0: The matrix squashes everything onto a line (or a point) — it’s not invertible!
- det < 0: The transformation flips orientation (like looking in a mirror)
Challenge: Go back to the transformation sliders and set:
- a=2, b=0, c=0, d=3. What’s the determinant? (6 — areas get 6x bigger)
- a=1, b=2, c=2, d=4. What’s the determinant? (0 — the matrix is singular!)
- Can you find settings where the determinant equals exactly 1?
Wrapping Up
| Concept | What It Means |
|---|---|
| Matrix | A rectangular grid of numbers |
| 2x2 transformation | Maps (x, y) to (ax+by, cx+dy) |
| Identity matrix | Does nothing — the “1” of matrices |
| Determinant | How much areas change; 0 means not invertible |
| Rotation matrix | Uses cos and sin to rotate points |
Matrices are one of the most powerful tools in mathematics. They’re used in computer graphics (every 3D game uses matrices!), physics, engineering, machine learning, and much more. This is just the beginning.