Interactive guide

Almost every direction turns. A few refuse to.

Apply a matrix to a vector and, generally, it ends up pointing somewhere new. But for a handful of special directions, the matrix only stretches or shrinks the vector; it never rotates it. Those directions are eigenvectors, and how much they stretch is their eigenvalue.

Think of it like stretching a photo. Grab a picture and pull it wider, without rotating it. Every diagonal line in that photo tilts to some new angle, except the horizontal and vertical lines: they don't tilt at all, they just get longer. Those two directions are the eigenvectors of that stretch, and "how much longer" each one got is its eigenvalue. Stretch the photo along a diagonal instead, and the directions that refuse to tilt move too, they're just not the horizontal and vertical ones anymore (try the Symmetric stretch preset below). Spin the photo instead of stretching it, and nothing survives untilted at all: a pure rotation has no real eigenvectors, which is exactly what the Rotation preset shows.

Drag v. Watch Mv.

Below, v (blue) is a vector you can drag around the unit circle. Mv (orange) is what the matrix does to it, drawn live. For most positions the two arrows point in clearly different directions: the matrix rotated v.

Keep dragging and watch for the moment they line up into a single direction, just a different length. That's an eigenvector. The ratio of the lengths (how much longer or shorter Mv is than v) is the eigenvalue for that direction.

Different matrices behave very differently: some have two eigenvector directions, one has every direction as an eigenvector, one has only a single direction despite being a 2×2 matrix, and one (a pure rotation) has none at all.

What "eigen" means here

  1. 1

    Mv = λv

    The defining equation. v is the eigenvector, λ (lambda) is the eigenvalue: a single number, not another direction.

  2. 2

    λ > 1 stretches, 0 < λ < 1 shrinks

    λ = 1 leaves it exactly alone. A negative λ flips it to point the opposite way, still on the same line.

  3. 3

    λ = 0 crushes it to the origin

    That whole direction gets flattened; the matrix has no way to undo this, which is exactly why it isn't invertible.

  4. 4

    Not every matrix has real ones

    A pure rotation turns every direction by the same angle; nothing lines back up with itself.

The same Scaling matrix, M = [[2, 0], [0, 0.5]]. Pick a vector below and watch the exact arithmetic that decides whether it's an eigenvector.

 v    Mv

Pick a vector to test

Drag the blue dot around the circle.

 v (drag me)    Mv    aligned: this is an eigenvector

Matrix

Eigenvalue λ

Try Rotation and drag all the way around the circle . The two arrows never once line up, because a pure rotation turns every direction by the same angle. Then try Shear and notice only one spot on the entire circle aligns, not two; most 2×2 matrices have two independent eigenvector directions, but this one is missing one.

The same matrix applied to the whole circle at once.

 unit circle (input)    transformed shape (output)    eigenvector direction

For a symmetric matrix (equal off-diagonal entries), the eigenvector lines are always exactly the ellipse's long and short axes. Shear isn't symmetric; its one eigenvector direction doesn't line up with the ellipse's axis at all, even though it's still a perfectly valid direction that doesn't rotate.

Where this actually shows up: PCA

Principal Component Analysis gets taught as its own algorithm, but it isn't really one: it's an eigendecomposition, full stop. Swap the fixed matrix M from every panel above for a dataset's own covariance matrix, and its eigenvectors are exactly what PCA calls principal components. The eigenvalue attached to each one is how much of the data's total spread that direction accounts for.

This is also why the symmetric-matrix fact from the panel above isn't a footnote: a covariance matrix is always symmetric, so its eigenvectors are always perpendicular, guaranteed, no matter what the data looks like. That's the entire reason PC1 and PC2 always meet at a right angle.

Three datasets below, at three different correlation strengths. The eigendecomposition runs exactly the same way every time; only how lopsided the resulting eigenvalues are changes.

PCA, as an eigendecomposition

  1. 1

    Build the covariance matrix

    A symmetric matrix: how every pair of features varies together, computed straight from the data.

  2. 2

    Find its eigenvectors

    Mv = λv, same equation as above. Symmetric means they come out perpendicular for free.

  3. 3

    Sort by eigenvalue

    The biggest eigenvalue's eigenvector is PC1: the single direction the data spreads out the most.

  4. 4

    Keep the top few, drop the rest

    That's dimensionality reduction: the small-eigenvalue directions were mostly noise to begin with.

Pick a dataset and watch the eigenvectors of its covariance matrix.

 data point    PC1 (top eigenvector)    PC2

Dataset

Eigenvalues (λ₁, λ₂)
Variance explained

Want to drag the points yourself? See the full Principal Component Analysis page.

Every one of those three plots ran the exact same four steps: build a symmetric matrix, decompose it, sort by eigenvalue, keep what matters. The matrix is the only thing that changes from field to field. Swap the covariance matrix for a graph's adjacency matrix and this same machinery drives spectral clustering. Swap it for a loss function's Hessian and its eigenvalues tell you whether a critical point on the Gradient Descent page's error surface is a minimum, a maximum, or a saddle: the exact curvature question that page never has to ask, because a plain least-squares bowl only ever has one kind of point to find. Once Mv = λv is visible, it turns out to be everywhere.

The jargons

An eigenvector is a direction a matrix leaves alone; an eigenvalue is how much it stretches that direction. Everything else here is either how to find them or what happens when a matrix doesn’t have enough of them to go around.

Eigenvector

A nonzero vector whose direction a matrix leaves unchanged: the output is a scalar multiple of the input.

Eigenvalue λ

The scalar in Mv = λv: how much the eigenvector gets stretched, shrunk, or flipped.

Characteristic polynomial

The equation whose roots are the eigenvalues. For a 2×2 matrix it's just a quadratic, solvable with the same formula from algebra class.

Defective matrix

One with fewer independent eigenvector directions than its size, like Shear, a 2×2 matrix with only one.

Symmetric matrix

Equal off-diagonal entries (b = c). Always has real eigenvalues, and its eigenvectors are always perpendicular to each other.

Singular matrix

Has an eigenvalue of exactly 0: some direction gets crushed to the origin, so the transformation can't be undone.

Covariance matrix

A symmetric matrix built from data: each entry says how two features vary together. PCA's "M" is always this matrix.

Principal component PC1, PC2, ...

An eigenvector of the covariance matrix, numbered by its eigenvalue: PC1 is the direction of greatest spread, PC2 the next-greatest that's still perpendicular to it.

Variance explained

A principal component's eigenvalue as a fraction of the total: how much of the data's spread that one direction alone accounts for.

A teaching tool: every matrix here is a fixed 2×2, chosen to show a genuinely different outcome; the eigenvalues shown are computed live from the same quadratic formula shown above.