The idea
Key formulas
Action on a vector
Loading lessons…
Just a moment, getting everything ready. The first load can take up to a minute.
Linear algebra
A matrix moves every point in a coordinated way, transforming the whole plane.
A matrix transformation takes each input vector to an output vector. For a two-dimensional square matrix,
The two coordinates of the answer are weighted combinations of both input coordinates. This is more than a convenient arithmetic rule: it describes how one consistent operation acts on every vector in the plane.
A transformation is linear when it preserves vector addition and scaling:
Consequently it also preserves any linear combination: . Linear maps send the origin to the origin; a translation by a fixed offset is not linear, though it can be represented by a matrix together with an added bias. A matrix is the coordinate description of a linear map after choosing bases for the input and output spaces.
The columns show the transformation in a particularly useful way. Let
Then is the first column of , and is its second column. Any vector is , so
Thus the columns tell you where the two basis arrows go, and every other arrow follows by taking the same combination of those transformed arrows. In the plane, the unit square becomes the parallelogram spanned by the columns. This gives a visual explanation for why a matrix changes the whole grid in a coordinated manner.
Different familiar transformations have simple matrices. A rotation by angle uses
and scaling the horizontal and vertical directions by uses
Reflecting across the -axis changes the sign of , so its matrix is . A shear such as leaves horizontal positions unchanged while shifting points according to their height.
For a square matrix, the determinant describes the signed area scale. For a two-dimensional matrix,
The transformed unit square has area : a determinant of doubles area, while doubles area and reverses orientation. The sign records whether the transformation preserves or reverses orientation. If the determinant is zero, the columns are dependent, so the parallelogram has zero area: the plane has been flattened into a line or a point, and the transformation cannot be inverted on the whole plane. This area interpretation generalizes to volume in higher dimensions.
Applying first and then means computing . The combined transformation is represented by , not . In general, : rotating and then stretching can produce a different result from stretching and then rotating. Matrix multiplication is therefore not a bookkeeping convention; it encodes the order of actions.
Matrix multiplication also preserves the defining properties of linear maps. Since each map respects addition and scaling, their composition does too. This lets us combine a sequence of rotations, reflections, and shears into one matrix and apply that product to a vector. The product's columns then give the final destinations of the original basis vectors, even if the intermediate steps are easier to understand separately.
The determinant provides a useful check on such a sequence: . Area scales multiply, and orientation reversals compose: two reflections reverse orientation twice, so their combined determinant is positive. If any step collapses an input direction, its determinant is zero, and later transformations cannot recover the lost dimension. This also explains why a zero-determinant square matrix has no inverse. When the determinant is nonzero, the map is invertible: each output corresponds to exactly one input.
Not all matrix transformations preserve the grid's familiar right angles. A shear keeps one direction fixed but changes angles between other directions. A nonuniform scale stretches different directions by different amounts. A rotation and reflection, in contrast, preserve lengths and angles because their columns form an orthonormal basis. Such geometric facts can often be read from the matrix's action on basis vectors, without applying it to every point.