A matrix looks like a lifeless table of numbers. It isn't. It's a verb: an instruction that grabs the entire plane and stretches, shears, spins or flips it — all at once, everywhere, in a way that keeps grid lines straight and parallel. Drag the four entries of A and watch the coloured grid deform. The shaded square is the image of the unit square; its signed area is the determinant. Toggle on the inverse, the eigenlines, a second matrix to compose with, or switch to a live 3×3 where the determinant becomes a signed volume.
A linear map is any transformation of space that (a) sends straight lines to straight lines through the origin and (b) respects addition and scaling: T(αu + βv) = αT(u) + βT(v). Because any vector is a combination of the basis arrows, the map is completely determined by where î and ĵ go:
Applying A to any point is then just a weighted sum of those columns:
The determinant is the signed area of the image of the unit square — the parallelogram spanned by the two columns:
The inverse reverses the motion, and it exists exactly when no area was destroyed (det ≠ 0):
Composition is stacking motions. Doing B then A is the single matrix product AB, and areas simply multiply:
Into 3D. Nothing changes but the count: a 3×3 matrix is decided by where î, ĵ, k̂ land (its three columns), and its determinant is the signed volume of the parallelepiped they span:
Why it matters. Rotations, camera projections, image warps, the Jacobian of a change of variables, PageRank, and every neural-network layer are this exact object: space, moved by a rule you can watch.
Real computation. Every frame the sketch reads the live matrix entries, maps each grid vertex by the actual matrix–vector product, computes det = ad−bc (2×2) or the scalar triple product of the columns (3×3), inverts via the closed-form adjugate/det, and — when composing — forms the true matrix product AB before mapping. Nothing is precomputed or tabled.
Cross-checks shown on screen. The shaded parallelogram's area is measured geometrically (the shoelace formula on its four corners) and matches the algebraic ad−bc to the displayed precision. Eigenvalues satisfy λ₁+λ₂ = trace and λ₁λ₂ = det — both visible in the readout so the solver can be checked against the invariants. The inverse grid, when overlaid on the forward grid, returns the standard grid — a live identity check A⁻¹A = I.
Degenerate cases handled. As det → 0 the inverse toggle is suppressed and a "singular — no inverse" flag appears; the parallelogram collapses to a segment. Negative determinants flip the fill colour and report "orientation reversed." Complex eigenvalues (rotational maps) are reported as a conjugate pair rather than drawn as fake eigenlines.
Built to sit alongside the repo's other applets (Eigenvectors #23, Lorenz, Hopf, Poincaré disc, Riemann lab) and to link directly to the eigenvector "grain" idea. Idea #40 from the 45 maths visual-teaching ideas list. Tech: p5.js, self-contained single file, KaTeX for the formulae.