School/✦ Research Engineer/Week 3
Rotation, shear, stretch and projection
Every 2×2 matrix is a picture. Can you guess what [[1, 1], [0, 1]] does to a square before you calculate anything?
About 40 min · 3 goals · Checked by automated tests
1.Why should I care?
Robots rotate frames, cameras project 3D onto 2D, materials shear under load. Recognising these maps by their matrices lets you debug a transform at a glance.
- ◇ Read a linear map from where its matrix sends î and ĵ.
- ◇ Write matrices for rotation by θ, shear, axis stretches, reflection and projection.
- ◇ Explain why a projection is not invertible and satisfies P² = P.
2.Watch
→ The key move: a matrix is completely determined by where it sends the basis vectors.
Shows a matrix as a description of where the basis vectors land, so you can read a transformation straight off its columns.
10 min 58 s · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
3.Predict
Where does [[1, 1], [0, 1]] send the point (0, 1)?
Guess first. Being wrong here is how the surprise works.
4.Discover
Load each preset in turn (rotate, shear, stretch, reflect, project). Before you look, predict where î and ĵ land from the matrix columns. Then drag a₂₂ towards 0 and watch the grid collapse.
Loading the interactive…
Can't use the interactive? Read a description instead
The grid diagram draws the image of a square grid and the unit square under the chosen matrix, with î and ĵ as labelled arrows. Sliders set each entry; presets load rotation, shear, stretch, reflection and projection. Text reports the determinant and whether orientation flips or the plane collapses.
5.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
A sends î to (2, 0) and ĵ to (0, 3). What is A?
6.Understand
Columns are images of the basis
A·(x, y) = x·A(î) + y·A(ĵ). So column 1 is A(î) and column 2 is A(ĵ). Linear maps keep the origin fixed, keep lines straight and keep evenly spaced grid lines evenly spaced.
A catalogue
Rotation by θ: [[cos θ, −sin θ], [sin θ, cos θ]], det 1. Shear: [[1, k], [0, 1]], det 1. Stretch: [[s₁, 0], [0, s₂]], det s₁s₂. Reflection in the x-axis: [[1, 0], [0, −1]], det −1. Projection onto the x-axis: [[1, 0], [0, 0]], det 0.
Projections
A projection P drops each vector onto a subspace. Doing it twice changes nothing more, so P² = P. It squashes a direction to zero, so det P = 0 and there is no inverse: from the shadow you cannot recover the object. Projection onto a unit vector u is P = uuᵀ, which reappears in least squares.
Explain it another way
Draw the unit square. Move its two edges from the origin to the matrix columns. The square becomes a parallelogram, and every other shape follows the grid.
A rotation matrix is orthogonal: RᵀR = I, so R⁻¹ = Rᵀ and lengths and angles are preserved.
A camera's projection from 3D points to the image plane (after dividing by depth) is the reason one photo cannot give you depth: a whole line of points maps to one pixel.
Worked example 1
Write the matrix that rotates by 90° anticlockwise and check it sends (1, 0) to (0, 1).
θ = 90°: [[0, −1], [1, 0]]. First column (0, 1) is where î lands. ✓ Second column (−1, 0): ĵ goes to −î, also correct.
Worked example 2
Find the matrix projecting onto the line through u = (1, 1)/√2.
P = uuᵀ = ½[[1, 1], [1, 1]]. Check P² = ¼[[2, 2], [2, 2]] = P. ✓ P(1, 0) = (0.5, 0.5), the foot of the perpendicular.
Common mix-ups
- Translation (shifting by a constant) is a linear map.
✓ Linear maps fix the origin. Translations need homogeneous coordinates (a 3×3 matrix in 2D). - The images of the basis vectors go in the rows.
✓ They go in the columns.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
[[1, 0], [0, −1]] is a…
Practice 3
For the rotation by 60°, what is the (2, 1) entry (sin 60°)?
Practice 4
P projects onto a line. What is P³?
Practice 5 · a fresh version every time
A = [[0, -4, 2], [1, 0, 0], [-3, -3, -3]] and B = [[0, -4, -2], [3, 4, 1], [5, -4, 0]]. What is the entry in row 3, column 1 of the product AB?
8.Apply it
Find a matrix that rotates by 45° and then stretches by 2 along x. Predict its columns by reasoning, then check with the transformation grid.
9.Reflect
Concepts: Matrices and linear transformations