Interactive reproduction of Figure 4.4 from Mathematics for Machine Learning (Deisenroth, Faisal & Ong). Five preset linear mappings show how a 2×2 matrix transforms a grid of points, and how eigenvectors stretch (or collapse) under that transformation. A custom matrix panel lets you explore any 2×2 transformation.
Each row shows three panels: original grid → eigenvectors scaled by eigenvalues → transformed grid. The color-coded points trace where each point lands under the mapping.
Horizontal axis compressed by ½, vertical axis stretched by 2.
Shearing along the horizontal axis. Eigenvectors are collinear.
Rotation by π/6 (30°). No real eigenvectors — eigenvalues are complex.
One eigenvector collapsed to 0, the other stretched to 2. Rank-1 mapping.
Shrinks by 0.75 overall, stretching by 1.5 in one direction and compressing by 0.5 in the orthogonal.
Enter your own 2×2 matrix entries. The panels update as you type. Try negative values, zero determinant, or values that produce complex eigenvalues.
Reference: Deisenroth, M.P., Faisal, A.A., Ong, C.S. Mathematics for Machine Learning, Figure 4.4. Cambridge University Press, 2020. Python companion (MML-Companion)