Matrix Transformations
What Is a Linear Transformation?
A linear transformation is a function from $\mathbb{R}^2$ to $\mathbb{R}^2$ that preserves addition and scalar multiplication. Geometrically, it maps straight lines to straight lines and fixes the origin. Every such transformation can be represented by a $2 \times 2$ matrix. The columns of the matrix tell you where the standard basis vectors $\mathbf{e}_1 = (1, 0)$ and $\mathbf{e}_2 = (0, 1)$ end up. Once you know where the basis goes, you know where everything goes.
Use the controls to manipulate the matrix entries directly, or choose a preset transformation. Watch how the shape and basis vectors change. The ghost shape shows the original; the bright shape shows the result.
How 2×2 Matrices Represent Transformations
A $2 \times 2$ matrix $\begin{bmatrix} a & b \\ c & d \end{bmatrix}$ acts on a vector $(x, y)$ by producing $(ax + by,\; cx + dy)$. The first column $\begin{bmatrix} a \\ c \end{bmatrix}$ is where the basis vector $\mathbf{e}_1 = (1, 0)$ lands. The second column $\begin{bmatrix} b \\ d \end{bmatrix}$ is where $\mathbf{e}_2 = (0, 1)$ lands. This is the key insight: to understand what a matrix does, just look at where it sends the two basis vectors. Everything else follows by linearity.
Watch the colored arrows in the visualization. The red arrow is the transformed $\mathbf{e}_1$; the blue arrow is the transformed $\mathbf{e}_2$. Their coordinates are exactly the columns of the matrix.
The Determinant
The determinant of $\begin{bmatrix} a & b \\ c & d \end{bmatrix}$ is $ad - bc$. Geometrically, it measures two things:
- Area scaling: The absolute value |det| tells you by what factor areas are multiplied. A determinant of 2 means areas double; a determinant of 0.5 means areas halve; a determinant of 0 means the transformation collapses everything onto a line or a point (the matrix is not invertible).
- Orientation: If det > 0, the transformation preserves orientation (counterclockwise stays counterclockwise). If det < 0, it reverses orientation (a reflection is involved).
Eigenvectors and Eigenvalues
An eigenvector of a matrix A is a nonzero vector v such that Av = λv for some scalar λ (the eigenvalue). Geometrically, eigenvectors are directions that the transformation merely scales, without rotating. The eigenvalue tells you the scale factor along that direction.
Not every 2×2 matrix has real eigenvectors. A pure rotation, for instance, does not scale any direction—it rotates everything—so its eigenvalues are complex. When eigenvectors exist and are real, they are shown as dashed lines in the visualization.
Composition of Transformations
Applying transformation B and then transformation A is the same as applying the single transformation AB (matrix multiplication). Matrix multiplication is associative but not commutative: AB ≠ BA in general. Use the "Apply & Chain" button to compose transformations and see this non-commutativity in action. Try rotating then shearing, versus shearing then rotating—the results are different.
What to Try
- Rotation: Click Rotate and drag the angle slider. Watch the basis vectors trace a circle. The determinant stays 1 (area is preserved).
- Shear: Click H-Shear and increase k. One basis vector stays fixed; the other slides. The determinant stays 1 (shears preserve area).
- Reflection: Click Reflect X. The determinant is −1 (orientation reverses). Use the F-Shape to see the mirror effect clearly.
- Projection: Click Proj X. The determinant is 0 (the transformation is not invertible—it collapses a dimension).
- Scaling: Try negative scale factors. Negative x-scale mirrors horizontally; both negative is a 180° rotation.
- Composition: Apply a rotation, then chain a shear on top. Compare with shearing first, then rotating. The order matters.
- Eigenvectors: Enable the eigenvector display and try different transformations. Notice that reflections have two real eigenvectors; rotations (except 0° and 180°) have none.