16.4

Linear Algebra Visualizer

Visualize 2D linear transformations interactively. See how matrices transform space by watching basis vectors, the unit square, and eigenvectors respond to rotations, scaling, shearing, and reflections.

Math Foundations for CS
Scenarios:
-5
-5
-4
-4
-3
-3
-2
-2
-1
-1
1
1
2
2
3
3
4
4
5
5
x
y
i-hat (1,0)
j-hat (0,1)
Original
Transformed
Determinant1.00
Angle
Scale1.00x
Steps0
Transform Controls
Angle0\u00b0
Transformation Matrix
1.00
0
0
1.00
Matrix x Vector
1.000
01.00
*
xy
=
1.00x + 0y0x + 1.00y
Eigenvalues
lambda_1 =1.00
lambda_2 =1.00
Determinant = 1.00The determinant (1.00) represents how much the transformation scales area. The unit square's area goes from 1 to 1.00.
1.0x
Understanding Linear Transformations

Core Idea

A 2x2 matrix represents a linear transformation of 2D space. The columns of the matrix tell you where the basis vectors i-hat (1,0) and j-hat (0,1) land after the transformation. Every other point in space follows accordingly, maintaining the grid lines parallel and evenly spaced.

Transformations

Rotation[cosθ, -sinθ; sinθ, cosθ]
Preserves lengths and angles. det = 1.
Scaling[sx, 0; 0, sy]
Stretches/compresses along axes. det = sx*sy.
Shear[1, k; 0, 1]
Slides along one axis. det = 1 (area preserved).
Reflection[1, 0; 0, -1]
Mirrors across an axis. det = -1 (flips orientation).
Key InsightEigenvectors are the special directions that do not change direction under a transformation -- they only get scaled by their eigenvalue. For a rotation matrix (except 0 and 180 degrees), eigenvalues are complex numbers, meaning no direction remains unchanged. This is why pure rotations have no real eigenvectors. Understanding eigenvalues is crucial for stability analysis in dynamical systems, principal component analysis (PCA) in machine learning, and Google's PageRank algorithm.

Key Properties

PropertyFormulaGeometric Meaning
Determinantad - bcArea scaling factor; sign = orientation
Tracea + dSum of eigenvalues
Inverse(1/det)[d,-b;-c,a]Undo the transformation
Eigenvalues(tr +/- sqrt(tr^2-4det))/2Scale factors along invariant directions
Singulardet = 0Collapses dimension; not invertible
OrthogonalM^T * M = IPreserves lengths and angles