Eigenvalue Transformation Visualizer

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 grideigenvectors scaled by eigenvaluestransformed grid. The color-coded points trace where each point lands under the mapping.

A₁ — Scaling (det = 1, area-preserving)

Horizontal axis compressed by ½, vertical axis stretched by 2.

Original

Eigenvectors

Transformed

A₂ — Shear (det = 1, area-preserving)

Shearing along the horizontal axis. Eigenvectors are collinear.

Original

Eigenvectors

Transformed

A₃ — Rotation (det = 1, complex eigenvalues)

Rotation by π/6 (30°). No real eigenvectors — eigenvalues are complex.

Original

Eigenvectors

Transformed

A₄ — Projection (det = 0, singular)

One eigenvector collapsed to 0, the other stretched to 2. Rank-1 mapping.

Original

Eigenvectors

Transformed

A₅ — Shear + Stretch (det = 0.75)

Shrinks by 0.75 overall, stretching by 1.5 in one direction and compressing by 0.5 in the orthogonal.

Original

Eigenvectors

Transformed

Interactive: Custom 2×2 Matrix

Enter your own 2×2 matrix entries. The panels update as you type. Try negative values, zero determinant, or values that produce complex eigenvalues.

Quick presets:

Original

Eigenvectors

Transformed

λ₁ v₁ (first eigenvector, red)
λ₂ v₂ (second eigenvector, blue)
Unit circle reference

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)

Comments