Visualize Matrix Multiplication | QuantumSketch
Visualize matrix multiplication as a transformation of space: the matrix moves the basis vectors î and ĵ, and the whole grid follows. Here's the animation.
Visualize matrix multiplication as a transformation of space: the matrix says where the basis vectors î and ĵ land, and the entire grid follows. The columns of the matrix are the new homes of î and ĵ.
The core idea
A 2×2 matrix like
means: î (1,0) goes to (2,0), and ĵ (0,1) goes to (1,1). Every point on the plane moves by that same linear rule, so the square grid shears into a parallelogram grid.
The animation, beat by beat
- Show the unit grid with î (green) and ĵ (red) highlighted.
- Introduce the matrix beside the grid.
- Apply it — the grid smoothly shears as î and ĵ slide to the matrix's columns.
- Track a sample vector so viewers see it move too.
- Compose two matrices to show that multiplication = "do one, then the other."
Why this beats the dot-product rule
Memorizing "row times column" hides the meaning. Watching the grid deform shows that a matrix is a transformation — and that AB means "apply B, then A." That's why determinant (area scaling) and eigenvectors suddenly make sense.
Manim makes this easy
| Element | Manim object |
|---|---|
| Grid | NumberPlane |
| Basis vectors | Vector, Arrow |
| The transform | ApplyMatrix |
ApplyMatrix([[2,1],[0,1]], plane) animates the whole deformation in one call.
The prompt
"Show the unit grid with basis vectors î and ĵ, then apply the matrix [[2,1],[0,1]] so the grid shears and the vectors land on the columns."
→ Render it at quantumsketch.app. Related: Visualize Eigenvectors, How to Visualize Vectors.
Written by Shihab Shahriar Antor · Shahriar Labs
FAQ
Q.What does matrix multiplication actually do, geometrically?
A matrix is a linear transformation of space: it tells you where the basis vectors î (1,0) and ĵ (0,1) land, and every other point follows that same rule. The columns of a 2×2 matrix are the new positions of î and ĵ. Multiplying the matrix by a vector means 'apply this transformation to that vector.' Multiplying two matrices means 'do one transformation, then the other.' Animating the grid stretching, rotating, or shearing as the basis vectors move makes this far more intuitive than memorizing the row-by-column dot-product rule.
Q.How can I animate a matrix transforming the plane?
Describe it to an AI animation tool: 'Show the unit grid with basis vectors î and ĵ, then apply the matrix [[2,1],[0,1]] so the grid shears and the vectors move to their new positions.' QuantumSketch renders that as a narrated Manim clip. Manim has a built-in ApplyMatrix animation and a NumberPlane object designed for exactly this, so the grid deforms smoothly while the basis vectors track to the matrix's columns — but you only write the prompt, not the code.