Matrix Transformations in 2D and 3D
Matrix Transformations in 2D and 3D
Matrices provide a compact, powerful way to describe geometric transformations. Every linear transformation (reflection, rotation, enlargement, shear, stretch) can be represented by a matrix, and combining transformations corresponds to multiplying matrices.
Fundamental Principle
A transformation T that maps point (x, y) to (x', y') is linear if and only if it can be written as:
[[x'], [y']] = M [[x], [y]]
for some 2×2 matrix M. To find M, apply the transformation to the basis vectors:
- Column 1 of M = image of e₁ = [[1], [0]] (the unit vector along x)
- Column 2 of M = image of e₂ = [[0], [1]] (the unit vector along y)
Standard 2D Transformations
| Transformation | Matrix | Notes |
|---|---|---|
| Reflection in x-axis | [[1, 0], [0, −1]] | y-coordinates negated |
| Reflection in y-axis | [[−1, 0], [0, 1]] | x-coordinates negated |
| Reflection in y = x | [[0, 1], [1, 0]] | Swap x and y |
| Reflection in y = −x | [[0, −1], [−1, 0]] | Swap and negate |
| Reflection in y = (tan α)x | [[cos 2α, sin 2α], [sin 2α, −cos 2α]] | General mirror line through origin |
| Rotation by θ anticlockwise | [[cos θ, −sin θ], [sin θ, cos θ]] | About the origin |
| Enlargement scale factor k | [[k, 0], [0, k]] | Centre at origin |
| Stretch factor k in x | [[k, 0], [0, 1]] | Parallel to x-axis |
| Stretch factor k in y | [[1, 0], [0, k]] | Parallel to y-axis |
| Shear factor k (x-direction) | [[1, k], [0, 1]] | Points slide parallel to x-axis |
| Shear factor k (y-direction) | [[1, 0], [k, 1]] | Points slide parallel to y-axis |
Properties from the Matrix
| Property | How to check | ||
|---|---|---|---|
| Area scale factor | \ | det(M)\ | |
| Orientation preserved | det(M) > 0 | ||
| Orientation reversed | det(M) < 0 | ||
| Transformation is invertible | det(M) ≠ 0 | ||
| Inverse transformation | M⁻¹ |
Combining Transformations
If transformation S is applied first, then T is applied second, the combined transformation is:
Combined matrix = T × S (note: right-to-left order!)
Example: Reflect in the x-axis then rotate 90° anticlockwise.
- Reflection: S = [[1, 0], [0, −1]]
- Rotation: T = [[0, −1], [1, 0]]
- Combined: TS = [[0, −1], [1, 0]] × [[1, 0], [0, −1]] = [[0, 1], [1, 0]]
The result is a reflection in y = x — confirming that two specific transformations can compose to a third.
Invariant Points and Lines
An invariant point satisfies Mp = p, i.e., (M − I)p = 0.
- The origin is always invariant under any linear transformation
- Other invariant points exist only if det(M − I) = 0
An invariant line is a line that maps to itself (individual points may move along it).
- For a line through the origin y = mx: substitute [[x], [mx]] into M[[x], [mx]] and check if the image is also on y = mx
- The x-axis and y-axis are invariant lines worth checking first
Line of invariant points = every point on the line is fixed (the eigenvectors with eigenvalue 1).
3D Transformations
In 3D, transformations use 3×3 matrices acting on [[x], [y], [z]].
Standard 3D Transformations
| Transformation | Matrix |
|---|---|
| Reflection in xy-plane (z = 0) | [[1,0,0], [0,1,0], [0,0,−1]] |
| Reflection in xz-plane (y = 0) | [[1,0,0], [0,−1,0], [0,0,1]] |
| Reflection in yz-plane (x = 0) | [[−1,0,0], [0,1,0], [0,0,1]] |
| Rotation θ about z-axis | [[cosθ,−sinθ,0], [sinθ,cosθ,0], [0,0,1]] |
| Rotation θ about x-axis | [[1,0,0], [0,cosθ,−sinθ], [0,sinθ,cosθ]] |
| Rotation θ about y-axis | [[cosθ,0,sinθ], [0,1,0], [−sinθ,0,cosθ]] |
| Enlargement factor k | [[k,0,0], [0,k,0], [0,0,k]] |
Volume scale factor = |det(M)| for 3D transformations.
Identifying a Transformation from its Matrix
Step-by-step approach:
1. Compute det(M): if |det| = 1, it could be rotation or reflection; if |det| ≠ 1, scaling is involved
2. Check if M = Mᵀ (symmetric): if so, it is a reflection
3. Check if MMᵀ = I (orthogonal): if so, it preserves distances (rotation or reflection)
4. If det = 1 and orthogonal → rotation; if det = −1 and orthogonal → reflection
5. Find eigenvalues: rotation matrices have complex eigenvalues; reflection matrices have eigenvalue 1 (mirror line) and −1
Successive Transformations: Worked Example
Question: Describe the transformation represented by M² where M is the rotation matrix for angle θ.
M = [[cos θ, −sin θ], [sin θ, cos θ]]
M² = [[cos θ, −sin θ], [sin θ, cos θ]] × [[cos θ, −sin θ], [sin θ, cos θ]]
= [[cos²θ − sin²θ, −2sinθcosθ], [2sinθcosθ, cos²θ − sin²θ]]
= [[cos 2θ, −sin 2θ], [sin 2θ, cos 2θ]]
This is a rotation by 2θ — as expected, applying a rotation twice doubles the angle.
Exam Tips
- Learn the standard matrices — you can derive any of them by tracking where (1,0) and (0,1) go
- Transformations compose right to left: "S then T" = TS, not ST
- det(M) gives the signed area scale factor — negative means orientation is flipped
- For 3D rotations, the axis of rotation corresponds to the unchanged coordinate (the row/column that matches the identity)
- Invariant lines ≠ lines of invariant points — on an invariant line, points may move along the line; on a line of invariant points, every point stays put
- To check your combined transformation, test it on a specific point and verify geometrically