jthomas.site// notebook · v.4.2026
Machine Learning, Visualized · Vol. I

Matrix
Transformations

A 2×2 matrix is a recipe for reshaping the plane. Set its four numbers and watch the grid bend, stretch, twist, or fold — each motion the visible signature of a single matrix.

The concept

A matrix is a rule for moving every point in the plane to a new location.

The trick: you only need to know where two arrows go. î is the unit arrow pointing right; ĵ points up. If you know where these two land, every other point follows by simply adding scaled copies of those two destinations. The matrix's two columns are literally those destinations.

So det(A) — the determinant — is just the area of the parallelogram those two arrows make. It tells you how much the transformation stretches or shrinks area, and a negative value means the orientation flipped.

Why ML cares

Every layer of a neural network is, at its core, a matrix multiplication followed by a nonlinearity. Understanding what a matrix does to space — bend it, rotate it, collapse it — is the foundation for understanding what neural networks do to data.

Convolutions, embeddings, attention scores, even gradient steps: they are all matrices acting on vectors. Build the geometric intuition here and the rest of the curriculum gets dramatically easier.

Try this
  1. Drag the bottom-right number — see how the ĵ arrow stretches vertically.
  2. Click Singular in the presets — det collapses to 0 and the whole plane folds onto a line.
  3. Click Reflect y, then pick the Letter F shape — it lands mirror-image because det = −1.
· Watch the dashed unit square become the filled parallelogram. Its corners are î′ and ĵ′ — the destinations of the unit basis vectors, which are literally the two columns of the matrix. The parallelogram's area is |det(A)|, the factor by which the matrix scales every region in the plane.
t = 1.00
Where you've seen this 04 examples
CSS transforms in your browser

Every transform: rotate(45deg) scale(1.5) on a webpage compiles into a 2×2 (or 3×3) matrix that the browser multiplies against every pixel of the element. The same matrix you've been dragging is what makes Instagram's photo flips and your phone's Auto-rotate happen.

Game engines and 3D graphics

Each frame of an animation moves characters by chaining matrices through their bones — a walking robot's joints, a cloth simulation, the camera's view. Unity, Unreal, and Blender are matrix-multiplication factories, doing this 60 times a second.

Robot arms and self-driving cars

A six-jointed robot arm has six matrices chained together; when the controller wants to point the gripper at a coffee cup, it solves for which entries achieve that pose. Self-driving cars do the same with LIDAR points, transforming sensor coordinates into the world frame.

Aligning medical scans

When a radiologist compares an MRI from January with one from July, software finds a 2D or 3D matrix that registers them — rotating, scaling, and shearing one image onto the other. Tumor growth measurements depend on getting that registration matrix right.

Further reading