Skip to content
ScienceQuest
Maths & Data Visualiser Undergraduate

Linear Transformation and Eigenvector Visualizer

Drag the basis vectors and watch a matrix warp the grid, with the determinant as an area and the eigenvectors as lines that stay put, in 2D or 3D.

Visualiser

Drag the tips of î′ and ĵ′, or the probe v; press anywhere to put v there. Keys 1, 2 and 3 pick one, and the arrow keys nudge it by 0.1. Space plays and pauses.

Try a matrix
Determinant
ad − bc = 1 × 1.5 − 1 × 0.5 = 1: the signed area of the parallelogram the unit square becomes. Negative means the plane is turned over, as a mirror turns it, and 0 means it is flattened.
1 area kept
Eigenvalues
The roots of λ² − 2.5λ + 1 = 0. The discriminant, tr² − 4 det, is 2.25: positive, so two real eigenvalues.
2 and 0.5
Eigenvectors
The directions A leaves on their own line, from (A − λI)v = 0: each is perpendicular to a row of A − λI. They are perpendicular to each other only when A is symmetric.
(1, 1) and (2, −1)
Trace
a + d, which is also the sum of the eigenvalues, as the determinant is their product.
2.5
Type
Scales (1, 1) by 2 and (2, −1) by 0.5, and every other vector by a mix of the two.
Stretch along two eigenlines
Singular values
The semi-axes of the ellipse the unit circle becomes: the most and the least A stretches any vector. Their product is |det|; turn on the ellipse to see them.
2.065 and 0.4842
Rank
The two columns point different ways and span the plane, so A can be undone.
2
Probe
Drag v on the stage, or press anywhere to put it there. When v lies on an eigenline, Av is a multiple of v, and both light up.
v (1, 1), Av (2, 2)
Matrix A
Show

Tips land on halves and the probe on eigenlines. Shift drags freely.

Compose

The stage shows BA, A then B, and Play shows each step in turn.

Citing this tool

Last updated . Add the date you accessed it as well, which a citation of a page that can change asks for. If a specific result matters, cite the permalink from the tool’s share row instead of this page: it reproduces the exact parameters.

Teaching with this? You can put it on a class page or LMS for free, with no ads inside the frame. Get the embed code.

The equation

det⁡A=ad−bc,λ2−(a+d)λ+(ad−bc)=0\det A = ad - bc, \quad \lambda^{2} - (a + d)\lambda + (ad - bc) = 0

Definition of the determinant and the characteristic equation

What is a 2D linear transformation matrix and determinant?

A 2D linear transformation maps each vector x to Ax through a 2×2 matrix A = [[a, b], [c, d]]. The determinant det(A) = ad − bc is the factor by which the transformation scales area, and its sign shows whether orientation is kept or flipped. Eigenvectors satisfy Av = λv: they stay on their own line through the origin and are only scaled by λ.

What a matrix does to the plane

A 2 × 2 matrix A = [[a, b], [c, d]] is a rule for moving every point of the plane: it sends (x, y) to (ax + by, cx + dy). Put in î = (1, 0) and out comes (a, c), the first column; put in ĵ = (0, 1) and out comes (b, d), the second. Every other point is x î + y ĵ, so it lands on the same mix of the two new arrows, x(a, c) + y(b, d). That is why grid lines stay straight, parallel and evenly spaced, why the origin never moves, and why the two columns, the two arrows you drag, are the whole matrix.

Using the visualiser

Drag the tip of î′ or ĵ′ and the matrix follows: the glyph in the corner prints the first column in î′’s colour and the second in ĵ′’s. Tips snap to multiples of 0.5; hold Shift, or turn snapping off, to place them anywhere, or type the four entries. Each preset under the stage is drawn as the shape it makes of the unit square, so a shear, a reflection or a projection is one tap away. Drag the probe v, or press anywhere on the plane to put it there, and Av is drawn beside it; when v lies on an eigenline, Av is a multiple of v and both light up. Play morphs the identity into A again. On the focused stage, 1, 2 and 3 pick î′, ĵ′ or v and the arrow keys move it by 0.1. The 3D tab takes a 3 × 3 matrix, and Then apply B composes two.

Worked example: [[1, 1], [0.5, 1.5]]

The matrix the visualiser opens on, worked by hand.

  1. The columns. î lands on (1, 0.5) and ĵ on (1, 1.5), the two arrows.
  2. The determinant. det A = ad − bc = 1 × 1.5 − 1 × 0.5 = 1. The unit square becomes a parallelogram of area 1, the same area, and the sign is positive, so orientation is kept.
  3. The eigenvalues. The trace is a + d = 2.5, so the characteristic equation is λ² − 2.5λ + 1 = 0, which factors as (λ − 2)(λ − 0.5) = 0: λ = 2 and λ = 0.5.
  4. The eigenvectors. For λ = 2, A − 2I = [[−1, 1], [0.5, −0.5]], whose rows are both perpendicular to (1, 1); for λ = 0.5, A − 0.5I = [[0.5, 1], [0.5, 1]], perpendicular to (2, −1). Check: A(1, 1) = (2, 2) = 2(1, 1), and A(2, −1) = (1, −0.5) = 0.5(2, −1). The two eigenlines meet at 71.57°, not 90°, because A is not symmetric.
  5. The singular values. With s = a² + b² + c² + d² = 4.5, σ = √((s ± √(s² − 4 det²))/2) gives 2.065 and 0.4842, the semi-axes of the ellipse the unit circle becomes. Their product is 1, which is |det A|, as it must be.

To see the characteristic equation as a curve, plot y = x² − 2.5x + 1 in the graphing calculator: it crosses zero at 0.5 and 2, the two eigenvalues.

The determinant is an area

A sends the unit square, with corners 0, î, î + ĵ and ĵ, to the parallelogram with corners 0, (a, c), (a + b, c + d) and (b, d). Its area is |ad − bc|, and every other shape’s area is multiplied by the same factor, since any shape is made of small squares that all change alike. Scale by 2 makes det 4, twice as wide and twice as tall, and the shear [[1, 1], [0, 1]] has det 1: it slides the square into a parallelogram with the same base and height.

The sign carries orientation. When det is positive, ĵ′ is still anticlockwise of î′, which the arc at the origin shows; when it is negative, the plane has been turned over, as a mirror turns it, and the arc turns the other way, as the reflection in y = x does with det −1. When det is 0 the two columns lie on one line and the whole plane is flattened onto it, as projection onto the x-axis does, with det 0 and rank 1. The zero matrix, rank 0, goes further and sends the whole plane to the origin. Nothing can undo either.

That is also why Play sometimes passes through a flat grid. The morph follows the straight path M(t) = (1 − t)I + tA, and det M(t) = (1 − t + tλ₁)(1 − t + tλ₂), which reaches 0 on the way, at t = 1/(1 − λ), whenever an eigenvalue λ is negative. The reflection in y = x, with λ = −1, is flat at t = 0.5, and a rotation by 180° passes through the zero matrix there. A rotation by less than 180° has complex eigenvalues and never flattens.

Eigenvectors are the lines that stay put

An eigenvector is a nonzero v with Av = λv: A only stretches it, by the eigenvalue λ, so v stays on its own line through the origin. Rewritten as (A − λI)v = 0, it has a nonzero solution only when det(A − λI) = 0, which for a 2 × 2 matrix is the characteristic equation λ² − (a + d)λ + (ad − bc) = 0.

Its discriminant, tr² − 4 det, decides what you see. Positive, as for the default with 2.25, gives two real eigenvalues and two eigenlines. Zero gives one eigenvalue twice: either every direction is an eigenvector, as for 2I, or there is just one eigenline, as for the shear [[1, 1], [0, 1]], whose only eigenline is the x-axis. Negative gives a complex pair and no real eigenline at all. A rotation by 90° has λ² + 1 = 0, so λ = i and −i. [[1, −1], [1, 1]] has λ = 1 ± i, of modulus √2 = 1.414 and angle 45°, and it does exactly that: it turns every vector anticlockwise by 45° and scales it by 1.414.

Composition and order

Apply A and then B, and the single matrix that does both is BA, because B(Av) = (BA)v: the matrix next to the vector acts first. Order matters. A shear S = [[1, 1], [0, 1]] followed by a rotation R by 90° is RS = [[0, −1], [1, 1]], while the rotation followed by the shear is SR = [[1, −1], [1, 0]]. They are different maps, though they share their trace, 1, their determinant, 1, and their eigenvalues, 0.5 ± 0.866i, as BA and AB always do. Determinants multiply in either order, det(BA) = det B det A. The rotation matrix itself, [[cos θ, −sin θ], [sin θ, cos θ]], has as its columns the points at θ and θ + 90° on the unit circle explorer’s circle.

In three dimensions

A 3 × 3 matrix’s three columns are where î, ĵ and k̂ land, and the unit cube becomes the parallelepiped they span. Its signed volume is the determinant, the triple product Aî · (Aĵ × Ak̂), which is how the 3D vector and cross product explorer finds a box’s volume. The same product gives any crystal’s unit cell volume from its three edge vectors; for the cubic cells of the crystal lattice explorer it is simply a³.

The 3D tab opens on [[1, 0.5, 0], [0, 1, 0.5], [0.5, 0, 1]]. Its characteristic cubic is λ³ − 3λ² + 3λ − 1.125 = 0, which is (λ − 1)³ = 0.125, so λ = 1.5 along (1, 1, 1) and λ = 0.75 ± 0.4330i, of modulus 0.866 and angle 30°: it stretches the diagonal by 1.5 and turns the plane round it by 30° while shrinking it to 0.866. The determinant is 1.5 × 0.75 = 1.125. A cubic always crosses zero, so a real 3 × 3 matrix always has a real eigenvalue, which is why a rotation in space always has an axis: the rotation by 45° about z has λ = 1 along z and 0.7071 ± 0.7071i.

Common mistakes

  • Reading the images off the rows. î lands on the first column, (a, c), not the first row. For [[1, 1], [0.5, 1.5]], î lands on (1, 0.5), not on (1, 1).
  • Assuming eigenvectors are perpendicular. Only a symmetric matrix promises that. The default’s eigenlines, along (1, 1) and (2, −1), meet at 71.57°.
  • Losing the sign of the determinant. Area scales by |det|, but the sign says whether the plane is turned over: the reflection in y = x has det −1, not 1.
  • Writing AB for “A then B”. A then B is BA. The shear then the rotation is [[0, −1], [1, 1]]; written the other way round, [[1, −1], [1, 0]] is the rotation then the shear.

Common questions

What does a linear transformation do to the grid?

It keeps every grid line straight, parallel to its neighbours and evenly spaced, and it never moves the origin. The whole map is fixed by where î and ĵ land, which are the matrix’s two columns: [[1, 1], [0.5, 1.5]] sends î to (1, 0.5), ĵ to (1, 1.5), and any point (x, y) to x(1, 0.5) + y(1, 1.5). A map that bends a grid line or moves the origin is not linear.

What does the determinant mean geometrically?

It is the factor by which the matrix scales every area, with a sign for orientation. The default matrix [[1, 1], [0.5, 1.5]] has det = 1 × 1.5 − 1 × 0.5 = 1, so the unit square becomes a parallelogram of the same area. A negative determinant means the plane has been turned over, as the reflection in y = x does with det −1, and a determinant of 0 means the plane has been flattened onto a line, or by the zero matrix onto a single point, which no matrix can undo.

What are eigenvectors and eigenvalues, visually?

An eigenvector is a direction the matrix leaves on its own line, and its eigenvalue is the factor it is stretched by. For the default matrix, (1, 1) is stretched by 2, since A(1, 1) = (2, 2), and (2, −1) is squeezed by 0.5, since A(2, −1) = (1, −0.5). Every other direction is turned as well as stretched. Drag the probe onto either eigenline and both it and its image light up.

How do you find the eigenvalues of a 2×2 matrix?

Solve the characteristic equation λ² − (trace)λ + det = 0, where the trace is a + d and det = ad − bc. For the default matrix the trace is 2.5 and the determinant 1, so λ² − 2.5λ + 1 = 0, which factors as (λ − 2)(λ − 0.5) = 0 and gives 2 and 0.5. Each eigenvector then solves (A − λI)v = 0: for λ = 2 that is (1, 1), and for λ = 0.5 it is (2, −1).

Why does a rotation have no real eigenvectors?

Because it turns every direction, so none stays on its own line. A rotation by 90° has trace 0 and determinant 1, so its characteristic equation is λ² + 1 = 0, with roots i and −i, and the visualiser says so instead of drawing eigenlines. The only rotations with real eigenvectors are those by 0° and 180°, for which every vector is one, with λ = 1 and λ = −1.

Why does the order of matrix multiplication matter?

Because the two maps are applied in turn, and the other order is a different map. A shear [[1, 1], [0, 1]] followed by a 90° rotation is [[0, −1], [1, 1]], while the rotation followed by the shear is [[1, −1], [1, 0]]. As a product, A then B is written BA, because the matrix next to the vector acts first. Compose mode animates both orders, and the two always share their determinant, here 1.

What does a 3×3 matrix do to the unit cube?

It turns it into a parallelepiped, the box spanned by the three columns, whose signed volume is the determinant. The 3D default [[1, 0.5, 0], [0, 1, 0.5], [0.5, 0, 1]] has det 1.125: it stretches the diagonal (1, 1, 1) by 1.5, its one real eigenvalue, and turns the plane round that axis by 30° while shrinking it to 0.866, which is what its complex pair 0.75 ± 0.4330i means.