A 2D linear transformation is a function that maps every point in the plane to a new point in a way that preserves lines and the origin. Such transformations can always be represented by a matrix multiplication: . The columns of the matrix tell you where the standard basis vectors and land after the transformation - a key insight for visualizing what a matrix does.
Common 2D transformations include rotation (by angle θ), scaling (stretching or shrinking along axes), reflection (flipping over a line), and shear (tilting one direction while keeping the other fixed). Composing transformations means multiplying their matrices - and order matters because matrix multiplication is not commutative. Linear transformations form the geometric foundation of computer graphics, physics simulations, and machine learning (neural network layers are affine transformations: a linear transformation plus a translation).
Understanding Matrix Transformations in 2D
A useful way to predict a transformation is to follow a whole shape, not just one point. Start with a square whose corners are at the origin, one step right, one step up, and one step right and one step up. Transform each corner, then join the new corners in the same order.
Straight edges remain straight, so four transformed corners are enough to draw the new square. A circle usually becomes an ellipse after unequal scaling or shear. A grid is even more revealing.
Rotation turns the grid without changing its square cells. Scaling changes cell widths or heights.
Shear makes the cells into slanted parallelograms. Reflection reverses the direction in which the grid is traced.
The determinant gives important information that a picture can hide. Its absolute value tells how the area of every small region changes. If the determinant has absolute value two, every shape has twice its original area.
If it has absolute value one, area is preserved even when the shape is tilted or flipped. A negative determinant means the transformation reverses orientation. For example, a clockwise path around a triangle becomes a counterclockwise path after a reflection.
When the determinant is zero, different points can land on the same line or the same point. Information has then been lost, so the original shape cannot be recovered uniquely.
Recovering a transformation uses an inverse matrix. An inverse undoes the original action. Scaling by a factor of three is undone by scaling by one third.
A rotation is undone by rotating through the same angle in the opposite direction. A reflection is its own inverse, because reflecting twice returns every point to where it started. Shear can be undone with a shear of the opposite amount.
Only matrices with a nonzero determinant have inverses. This matters in graphics programs when a screen point must be mapped back onto an object, such as when checking whether a mouse click hit a rotated button or game character.
Students often make mistakes by treating matrix multiplication like ordinary number multiplication. The entries are calculated with row by column products, and the result describes one combined transformation. The action nearest a vector happens first.
It helps to write down the intermediate coordinates after each step rather than trying to guess the final picture. Test your work using simple vectors that lie on the horizontal or vertical axes. Notice whether lengths, right angles, area, and orientation should stay the same or change.
Rotations preserve lengths and angles. Uniform scaling preserves angles but changes lengths.
Shear usually changes angles. These checks catch many arithmetic errors before they spread through a longer calculation.
Key Facts
- Rotation by θ: [[cos θ, −sin θ], [sin θ, cos θ]] (counterclockwise)
- Scaling: [[sx, 0], [0, sy]] (scales x by sx, y by sy)
- Reflection over x-axis: [[1, 0], [0, −1]]; over y-axis: [[−1, 0], [0, 1]]
- Shear (horizontal): [[1, k], [0, 1]] shifts x by k times y
- Determinant = area scaling factor; means the transformation collapses to a lower dimension
- Composition: applying then (right-most matrix acts first)
Vocabulary
- Linear transformation
- A mapping between vector spaces that preserves vector addition and scalar multiplication; representable by a matrix.
- Determinant
- A scalar value of a square matrix that represents the scaling factor of the area (in 2D) under the transformation; zero determinant means the transformation is singular.
- Basis vector
- A vector in a set that, through linear combinations, can represent any vector in the space; the standard basis in 2D is (1,0) and (0,1).
- Composition
- Applying two transformations in sequence; mathematically represented by matrix multiplication (right-to-left order).
- Eigenvector
- A non-zero vector that is only scaled (not rotated) by a linear transformation; the scaling factor is the corresponding eigenvalue.
Common Mistakes to Avoid
- Reversing matrix multiplication order when composing transformations. Applying rotation then scaling is NOT the same as scaling then rotating. Matrix multiplication is not commutative: AB ≠ BA in general.
- Forgetting that linear transformations always fix the origin. Translations (moving the origin to a new point) are NOT linear transformations - they require homogeneous coordinates or affine notation.
- Confusing the rotation angle direction. The standard rotation matrix [[cos θ, −sin θ], [sin θ, cos θ]] rotates counterclockwise. Clockwise rotation uses −θ (or equivalently swaps the signs of the sin terms).
- Thinking a determinant of zero just means no rotation. Det = 0 means the matrix is singular: it collapses the plane onto a line or point, destroying information. The transformation cannot be undone (no inverse).
Practice Questions
- 1 Write the 2x2 matrix that rotates points 90° counterclockwise. Apply it to the point (3, 1) and verify geometrically.
- 2 A transformation first scales x by 2 and y by 3, then rotates 45°. Write the single matrix representing the composition (in correct order).
- 3 If a transformation matrix has determinant = 4, what happens to the area of a triangle that is transformed by it?