The idea: every point goes straight across the mirror

A reflection of the plane picks a mirror line through the origin and sends every point straight across it: along the line at a right angle to the mirror, to the same distance on the other side. Points on the mirror stay where they are. The map is linear (the origin stays, grid lines stay straight and evenly spaced), so it has a 2×2 matrix, written F here.

The mirror line at 30° through the origin. The vector v = (1, 2) in black and its image F·v ≈ (2.23, −0.13) in magenta. A dashed segment joins their tips; it meets the mirror at a right angle, and its midpoint P·v ≈ (1.62, 0.93) is marked on the mirror. Both v and F·v have length √5
v and F·v sit at the same distance from the mirror, on opposite sides; the segment between them meets the mirror at a right angle at its midpoint P·v.

On the canvas the grey grid stays put and is the ruler. The blue grid, the light-blue unit square, the orange letter F and the arrows î (red) and ĵ (green) move with the matrix; the purple line is the mirror. A grey ghost keeps the picture as it was before the last move. The panels on the right show the matrix, one point worked out row by row, and the facts about F.

The matrix F(θ)

Let the mirror make the angle θ with the x-axis. Then î = (1, 0) sits θ below the mirror, so it lands θ above it, at angle 2θ: (cos 2θ, sin 2θ). And ĵ = (0, 1) lands on (sin 2θ, −cos 2θ). Those are the columns:

F(θ)=[cos2θsin2θsin2θ−cos2θ]

The angle is doubled because the matrix only knows where î and ĵ go, and î ends up 2θ from where it started. The mirrors on the page:

Mirrorθ2θF(θ)What it does to (x, y)
x-axis0°0°[1 0; 0 −1](x, −y)
30° line30°60°[½ √3/2; √3/2 −½](½x + (√3/2)y, (√3/2)x − ½y)
y = x45°90°[0 1; 1 0](y, x): swap
60° line60°120°[−½ √3/2; √3/2 ½](−½x + (√3/2)y, (√3/2)x + ½y)
y-axis90°180°[−1 0; 0 1](−x, y)
y = −x135°270°[0 −1; −1 0](−y, −x)

The x-axis mirror only negates y: ĵ flips to (0, −1) and the F hangs upside down (Demo: mirror in the x-axis). The mirror y = x swaps the two coordinates, so v = (2, 1) lands on (1, 2) (Demo: mirror in y = x: swap x and y).

Straight across: the midpoint is the projection

To reflect a point v, drop it straight onto the mirror. That foot of the perpendicular is the projection P·v. Then keep going the same distance again: F·v = v + 2(P·v − v) = 2P·v − v. So

F=2P−I,P=12(I+F)

With the 30° mirror and v = (1, 2): row 1 · v = ½·1 + (√3/2)·2 = ½ + √3 ≈ 2.23 and row 2 · v = (√3/2)·1 − ½·2 = √3/2 − 1 ≈ −0.13. The midpoint ≈ (1.62, 0.93) lies on the mirror, and |v| = |F·v| = √5 (Demo: each point crosses at a right angle). The canvas shows the same thing for the whole picture: when you press Reflect, every anchor moves on a straight line, and halfway the map is ½(I + F) = P, so for one moment the whole picture is squashed onto the mirror. Projections have their own page: Projection Matrix.

Lengths kept, orientation reversed: det = −1

A reflection keeps every length and every angle, so it keeps areas too: the unit square stays a unit square. But it turns the plane over. A turn that was counter-clockwise becomes clockwise, and the letter F reads backwards. The determinant records both facts:

detF=−cos22θ−sin22θ=−1

Size 1: area is the same. Sign −: orientation is reversed. A rotation also keeps lengths and angles but has det = +1; both are orthogonal matrices (FᵀF = I), and the sign of the determinant tells them apart.

Left: the letter F and the unit square with a counter-clockwise arrow from î to ĵ, det = +1. Right: after the reflection in the y-axis the F is mirrored and the arrow from F·î to F·ĵ turns clockwise, det = −1. The square has the same area
Same area, opposite orientation: the turn from î to ĵ is counter-clockwise before and clockwise after, so det = −1.

Eigenvectors: on the line ×1, across ×−1

Two directions keep their line. A vector u along the mirror does not move: F·u = u, eigenvalue 1. A vector n at a right angle to the mirror comes out pointing the other way: F·n = −n, eigenvalue −1. For the mirror at θ, u = (cos θ, sin θ) and n = (−sin θ, cos θ). Every other vector changes direction. The eigenvalues agree with the matrix: their product 1·(−1) = −1 is the determinant and their sum 0 is the trace cos 2θ − cos 2θ. On the canvas the brown n shrinks to 0 at the halfway point and grows back reversed (Demo: eigenvectors: on the line ×1, across ×−1). More on eigenvectors: Eigenvectors & Eigenvalues.

A reflection undoes itself

Reflect twice in the same mirror and every point crosses over and back: F·F = I, so F−1 = F. The formula for the inverse agrees: swap the diagonal, negate the rest, divide by det = −1, and you get F again (Demo: reflect twice: back to the start). Because F is orthogonal and symmetric, F−1 = Fᵀ = F.

Two mirrors make a rotation

Reflect in a mirror at angle α, then in a mirror at angle β. Each flip reverses orientation, so two flips restore it (det = (−1)(−1) = +1): the result is a rotation, by twice the angle from the first mirror to the second.

F(β)·F(α)=R(2(β−α))

With the x-axis (α = 0°) and then y = x (β = 45°): [0 1; 1 0]·[1 0; 0 −1] = [0 −1; 1 0], the rotation by 90°. î goes to (1, 0) and then to (0, 1); the F ends up turned, not mirrored (Demo: two mirrors make a rotation (0° and 45°)). The order matters: F(0°)·F(45°) is the rotation by −90°. Rotations have their own page: Rotation Matrix.

Three panels. Start: the letter F. After the reflection in the x-axis: the F upside down. After the reflection in y = x: the F turned a quarter turn counter-clockwise from the start. Labels: F(0°), then F(45°); together R(90°)
Mirror in the x-axis, then in y = x: two flips give a quarter turn, twice the 45° between the mirrors.

See also the overview Linear Transformations and the sibling pages Rotation Matrix, Scaling Matrix, Shear Matrix and Projection Matrix; Matrix Multiplication for products such as F·F; Vectors and the Dot Product for the projection P·v = (v·u)u; Rotation and Scaling in 2D; and Complex Numbers, where the reflection in the x-axis is the conjugate z ↦ z̄.

What the page leaves out

Only mirrors through the origin are shown; a mirror that misses the origin moves it, so it is not linear (graphics adds it with a translation in 3×3 homogeneous coordinates). Reflections in 3D (across a plane, I − 2nnᵀ for a unit normal n), Householder reflections used in QR factorisation, reflections that are not orthogonal (oblique reflections along a slanted direction) and glide reflections are not drawn.