A 2×2 matrix takes the whole plane and shears, spins and stretches it. Almost every arrow comes out pointing somewhere new. But a special few come out pointing exactly along the line they started on — only longer or shorter. Those directions are the eigenvectors; the stretch factor is the eigenvalue. Drag the four matrix entries and watch the eigenlines snap into place.
An eigenvector of a matrix A is a nonzero vector v that A maps to a scalar multiple of itself:
Rearranging, (A − λI)v = 0 must have a nonzero solution, which forces the matrix A − λI to be singular. So its determinant vanishes — the characteristic equation:
Solving the quadratic gives the two eigenvalues from trace τ = a+d and determinant Δ = ad−bc:
Once you have a real λ, the eigenvector is any nonzero solution of (A − λI)v = 0. For a 2×2 you can read it straight off a row:
Reading the geometry. The unit circle you drag maps to an ellipse. Its principal directions aren't generally the eigenvectors (those come from the symmetric part / SVD) — but when eigenvalues are real, the eigenlines are exactly the directions the ellipse touches its own supporting parallel lines to the input. The determinant is the signed area scaling: det = λ₁λ₂, and the trace is λ₁+λ₂. You can verify both live in the readout.
Why it matters. Diagonalising A = PDP⁻¹ turns matrix powers, differential equations and Markov chains into scalar arithmetic on the eigenlines. Google's PageRank, the principal axes of inertia, the normal modes of a bridge, and PCA in machine learning are all the same trick: find the directions the operator merely scales.
Real computation. Every frame the sketch forms trace τ, determinant Δ and discriminant τ²−4Δ from the live slider values, solves λ² − τλ + Δ = 0 by the quadratic formula, and derives each eigenvector from a non-degenerate row of A − λI before normalising. Nothing is precomputed or tabled.
Cross-checks shown on screen. λ₁+λ₂ = trace and λ₁·λ₂ = det are both displayed so you can confirm the solver against the invariants at any time. The "aligned" gold highlight is triggered purely by the angle between v and Av dropping below a small threshold — an independent geometric witness that those directions really are fixed.
Degenerate cases handled. Complex eigenvalues (rotations) suppress the eigenlines and flag "no real eigenvector". Repeated real roots (shears, scalar-plus-nilpotent) report a single eigenline and a defect warning. A zero determinant (rank-deficient A) collapses the ellipse to a segment and reports a zero eigenvalue.
Built to sit alongside the repo's other applets (Lorenz, Hopf, Poincaré disc, Riemann lab). Idea #23 from the 25 maths visual-teaching ideas list. Tech: p5.js, self-contained single file, KaTeX for the formulae.