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.
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.
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.
- Drag the bottom-right number — see how the ĵ arrow stretches vertically.
- Click Singular in the presets — det collapses to 0 and the whole plane folds onto a line.
- Click Reflect y, then pick the Letter F shape — it lands mirror-image because det = −1.
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.
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.
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.
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.
- 3Blue1Brown — Essence of Linear Algebra video series Grant Sanderson · Chapter 3 covers linear transformations exactly the way the canvas above does, and is the single best 10-minute introduction to the subject.
- MIT 18.06 — Linear Algebra lecture course Gilbert Strang · The canonical undergraduate course. Free on OCW, with full video lectures and problem sets.
- MDN — CSS matrix() transform function reference The same six-number matrix that drives every CSS transform. Type one in the dev tools and watch this page's rotations apply to a real DOM element.
- Immersive Linear Algebra interactive book Ström, Åström, Akenine-Möller · Free online textbook with 3D figures you can drag around — heavy on geometric intuition.