Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Reflection across a Line


Linear Algebra·ReflectionFlip v across the mirror; same distance, other side. Reflection is its own inverse: R² = I.
mirrorPvRvv
v=(1.5, 2)
Rv=(2, 1.5)
Morph I → Rt = 1.000
t = 1.000

Reflect across y = x

det −1 · involution

Swaps coordinates: (x, y) ↦ (y, x). The diagonal is fixed; the anti-diagonal flips.
Learn more about diagonal reflections · the morph through P

Insight

R = 2P − I. Halfway through the I→R morph (t = 0.5) the map equals the projection P itself. The midpoint of v and Rv is exactly Pv.

AReflection matrixR = 2uuᵀ − I

R=
0110
θ45°

04Livedrag v

|v|2.5|Rv|2.5|v − Rv|0.71angle(v, mirror)8.13°det R-1trace R0
R²v = v · involution verified








Key Terms

Reflection across a line — the linear map sending each vector v\mathbf{v} to its mirror image on the other side of the line, the same distance away.

Reflection matrix — for the mirror at angle θ\theta, R=(cos2θsin2θsin2θcos2θ)R = \begin{pmatrix} \cos 2\theta & \sin 2\theta \\ \sin 2\theta & -\cos 2\theta \end{pmatrix}, equivalently R=2PIR = 2P - I with PP the projection onto the same line.

Mirror — the line of fixed points; every vector on it is its own reflection.

Involution — R2=IR^2 = I; reflecting twice returns every vector to where it started, so R1=RR^{-1} = R.

Orientation reversing — detR=1\det R = -1; the unit square comes back the same shape but flipped over.

Eigenvalues ±1\pm 1 — +1+1 along the mirror, 1-1 along the perpendicular; the two eigendirections are perpendicular.

Midpoint property — the midpoint of v\mathbf{v} and RvR\mathbf{v} is the projection PvP\mathbf{v}, the foot of the perpendicular on the mirror.

Isometry — Rv=v\|R\mathbf{v}\| = \|\mathbf{v}\|; reflections preserve lengths and angles.

Getting Started

The canvas shows a mirror line through the origin in blue, a draggable vector v\mathbf{v} in orange, its reflection RvR\mathbf{v} in cyan, a dashed perpendicular joining the two with a right-angle mark where it crosses the mirror, and a purple dot at the midpoint, labelled PvP\mathbf{v}.

Try this sequence to build intuition:

• Start on the y = x preset. Drag v\mathbf{v} and watch RvR\mathbf{v} move as its mirror image: the same distance from the line, on the other side, with the joining segment always perpendicular to the mirror.
• Drag v\mathbf{v} onto the mirror. RvR\mathbf{v} lands on top of it: points on the mirror are fixed.
• Press play in the animation panel. The grid and unit square morph from the identity to RR; halfway through, at t=0.5t = 0.5, the picture is the projection onto the mirror, and at t=1t = 1 the square has flipped over.
• Move the θ\theta slider in the matrix card and watch the four entries of RR change while detR\det R stays 1-1 and trR\operatorname{tr} R stays 00.

The point: a reflection is a rigid motion of the plane that cannot be achieved by turning, and detR=1\det R = -1 is the algebraic fingerprint of that.

Dragging the Vector

The tip of v\mathbf{v} is the only handle on the canvas.

• Drag v\mathbf{v} — RvR\mathbf{v} follows as the mirror image, the perpendicular and midpoint redraw, and the readouts under the canvas update
• Cross the mirror — v\mathbf{v} and RvR\mathbf{v} swap sides; on the line itself they coincide and the perpendicular vanishes
• Cross the perpendicular through the origin — when v\mathbf{v} is perpendicular to the mirror, Rv=vR\mathbf{v} = -\mathbf{v}, the eigenvalue 1-1 made visible

The mirror is not dragged. It is set by the presets or the θ\theta slider in the matrix card, because a line through the origin is one number, its angle.

The Morph Animation

The animation panel blends the identity into the reflection: M(t)=(1t)I+tRM(t) = (1 - t)I + tR for tt from 00 to 11, applied to the grid and the unit square.

• At t=0t = 0 the grid is the ordinary grid and the unit square is a square, filled blue for positive determinant
• At t=0.5t = 0.5 the map is 12(I+R)=P\tfrac{1}{2}(I + R) = P, the projection onto the mirror: the grid and square are flattened onto the line, and the fill turns grey for determinant 00
• At t=1t = 1 the grid has passed through the mirror and come out on the other side, and the unit square is filled purple for negative determinant: the same shape, flipped over

v\mathbf{v} and RvR\mathbf{v} are drawn independently of tt, so the mirror-image geometry stays readable while the background morphs. Selecting a preset replays the morph automatically. The passage through a flattened plane is not incidental: a reflection cannot be reached from the identity by any continuous family of invertible maps, because the determinant would have to cross from +1+1 to 1-1 through 00.

Preset Scenarios

The sidebar offers seven mirrors in three groups.

• Coordinate axes — the x-axis and the y-axis; RR is diagonal and simply negates one coordinate
• Diagonals — y=xy = x and y=xy = -x; RR swaps the coordinates, with or without a sign change
• Custom angle — 30°30°, 60°60° and 120°120°; off-diagonal entries appear, and the 120°120° mirror is the same line as 60°-60°

The three sections that follow take one representative from each group and freeze it, and a fourth freezes the morph halfway, where it passes through the projection. The explanation card in the tool links back to the matching section for whichever preset is active.

Reflection across a Coordinate Axis

On the x-axis preset the mirror is the x-axis and R=diag(1,1)R = \operatorname{diag}(1, -1): the map negates the second coordinate, (x,y)(x,y)(x, y) \mapsto (x, -y).

At the default v=(1.5,2)\mathbf{v} = (1.5, 2) the reflection is (1.5,2)(1.5, -2), straight below v\mathbf{v}, and the midpoint (1.5,0)(1.5, 0) sits on the axis.
mirrorPvRvv
x-axis reflection, frozen

v = (1.5, 2) flipped to Rv = (1.5, -2), straight below it, with the midpoint (1.5, 0) on the axis. R = diag(1, −1); the unit square has turned over and is filled purple for det = −1.

This is reflection with the trigonometry switched off: cos0°=1\cos 0° = 1 and sin0°=0\sin 0° = 0, so the matrix is diagonal, and the two axes are the eigendirections with eigenvalues 11 and 1-1 in plain view.

The y-axis preset negates the first coordinate instead, diag(1,1)\operatorname{diag}(-1, 1). Applying both in turn negates both coordinates, which is the 180°180° rotation, the simplest instance of two reflections composing to a rotation.

Reflection across a Diagonal

On the y=xy = x preset the mirror is the diagonal and R=(0110)R = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}: the map swaps the coordinates, (x,y)(y,x)(x, y) \mapsto (y, x).

At the default v=(1.5,2)\mathbf{v} = (1.5, 2) the reflection is (2,1.5)(2, 1.5), and the midpoint (1.75,1.75)(1.75, 1.75) lies on the diagonal.
mirrorPvRvv
y = x reflection, frozen

The coordinates swap: Rv = (2, 1.5), with the midpoint (1.75, 1.75) on the diagonal. The perpendicular joining v and Rv crosses the mirror at a right angle.

The swap is the coordinate form of mirror symmetry across y=xy = x, familiar from inverse functions, whose graphs are reflections of each other across this line.

The y=xy = -x preset swaps and negates, (x,y)(y,x)(x, y) \mapsto (-y, -x). Composing the two diagonal reflections gives a 180°180° rotation, because the two mirrors are perpendicular; composing y=xy = x with the x-axis gives a 90°90° rotation, because those mirrors are 45°45° apart.

Reflection across a Custom Angle

On the 30°30° preset the entries of RR are cos60°\cos 60°, sin60°\sin 60°, sin60°\sin 60°, cos60°-\cos 60°, that is 12\tfrac{1}{2}, 32\tfrac{\sqrt{3}}{2}, 32\tfrac{\sqrt{3}}{2}, 12-\tfrac{1}{2}. The doubled angle in the formula is what turns a 30°30° mirror into 60°60° entries.

At the default v\mathbf{v} the reflection lands on the far side of the 30°30° line at the same distance, with the perpendicular crossing the mirror at the midpoint.
mirrorPvRvv
30° reflection, frozen

Rv = (2.48, 0.3) on the far side of the 30° mirror at the same distance. The matrix entries are cos 60° and sin 60° - the doubled angle - and det R is still −1.

Whatever the angle, the trace is 00 and the determinant is 1-1; only how the entries share the rotation-like pattern changes. The θ\theta slider makes this a continuous experiment.

The 120°120° preset is instructive for a different reason: it is the same mirror as 60°-60°, so R(120°)=R(60°)R(120°) = R(-60°), and the slider's range of 0° to 180°180° already covers every reflection across a line through the origin. The 60°60° and 30°30° presets together compose to a 60°60° rotation.

Halfway through the Morph: The Projection

The frozen picture below stops the y=xy = x morph at t=0.5t = 0.5, where M=12(I+R)=PM = \tfrac{1}{2}(I + R) = P. The grid and unit square are flattened onto the mirror, the fill is grey for determinant 00, and v\mathbf{v} and RvR\mathbf{v} are still drawn at full strength with their purple midpoint.

That midpoint is the projection PvP\mathbf{v}, and it is exactly where the flattened grid would carry v\mathbf{v}.
mirrorPvRvv
Morph at t = 0.5, frozen

The y = x morph stopped halfway: M = (I + R)/2 = P, the grid and square flattened onto the mirror, det = 0, and the purple midpoint of v and Rv sitting exactly where P sends v.

The identity R=2PIR = 2P - I is the whole content of this picture. Reflection is projection continued past the mirror by the same distance, so the average of the identity and the reflection is the projection, and a straight-line morph from II to RR must pass through PP at its midpoint.

It also explains why the determinant changes sign along the way. The determinant of M(t)M(t) runs continuously from +1+1 to 1-1, so somewhere it is 00, and that somewhere is the projection: the one moment when the plane is flat and the map is not invertible. No path of invertible maps connects a reflection to the identity.

The Matrix Card and the Angle Slider

The matrix card shows the four entries of RR for the current mirror and a slider for the angle θ\theta in degrees.

• The entries are cos2θ\cos 2\theta, sin2θ\sin 2\theta, sin2θ\sin 2\theta and cos2θ-\cos 2\theta; the matrix is symmetric and its diagonal entries are negatives of each other, so the trace is always 00
• The doubled angle is the reason the x-axis (θ=0°\theta = 0°) gives diag(1,1)\operatorname{diag}(1, -1) while the diagonal (θ=45°\theta = 45°) gives the coordinate swap (0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
• The slider runs from 0° to 180°180°, because a line has no orientation: θ\theta and θ+180°\theta + 180° are the same mirror and the same matrix

Moving the slider clears the current preset. Every RR it produces has detR=1\det R = -1; the family is one-dimensional, parametrized by the angle of the mirror.

The Live Card

The live card reports the numbers behind the picture.

• v\|\mathbf{v}\| and Rv\|R\mathbf{v}\| — always equal, since a reflection preserves lengths
• vRv\|\mathbf{v} - R\mathbf{v}\| — the length of the perpendicular joining the two, twice the distance from v\mathbf{v} to the mirror
• angle — between v\mathbf{v} and the mirror; RvR\mathbf{v} makes the same angle on the other side
• detR\det R and trR\operatorname{tr} R — always 1-1 and 00, the invariants of a reflection
• involution — a check that R(Rv)=vR(R\mathbf{v}) = \mathbf{v}, which holds by construction and is worth seeing stated

The midpoint of v\mathbf{v} and RvR\mathbf{v} is PvP\mathbf{v}, the projection onto the mirror, which is the picture behind the identity R=2PIR = 2P - I: go to the foot of the perpendicular and continue the same distance again.

What Reflection Is

The reflection of v\mathbf{v} across the line through the origin with unit direction u\mathbf{u} is built from the projection: the projection Pv=(vu)uP\mathbf{v} = (\mathbf{v} \cdot \mathbf{u})\,\mathbf{u} is the foot of the perpendicular, and the reflection continues the same distance beyond it,

Rv=2Pvv=2(vu)uvR\mathbf{v} = 2P\mathbf{v} - \mathbf{v} = 2(\mathbf{v} \cdot \mathbf{u})\,\mathbf{u} - \mathbf{v}


As a matrix, R=2uuTIR = 2\mathbf{u}\mathbf{u}^T - I, and with u=(cosθ,sinθ)\mathbf{u} = (\cos\theta, \sin\theta) the double-angle formulas give

R=(cos2θsin2θsin2θcos2θ)R = \begin{pmatrix} \cos 2\theta & \sin 2\theta \\ \sin 2\theta & -\cos 2\theta \end{pmatrix}


Every property on the live card follows from R=2PIR = 2P - I. Squaring: R2=4P24P+I=4P4P+I=IR^2 = 4P^2 - 4P + I = 4P - 4P + I = I, using P2=PP^2 = P, so a reflection is an involution. The trace is 2trP2=02 \operatorname{tr} P - 2 = 0. The eigenvalues are 211=12 \cdot 1 - 1 = 1 along the mirror and 201=12 \cdot 0 - 1 = -1 along the perpendicular, so the determinant is 1-1. And RR is symmetric because PP is.

Reflections are the building blocks of all rigid motions fixing the origin: every rotation is a product of two reflections, and every orthogonal 2×22 \times 2 matrix is either a rotation or a reflection. For the general theory of reflections, rotations and the other geometric transformations, see the geometric transformations theory page.

Composing Reflections

Two reflections in a row make a rotation, and the angle of the rotation is twice the angle between the mirrors.

• Reflect across the x-axis, then the y-axis: (x,y)(x,y)(x,y)(x, y) \mapsto (x, -y) \mapsto (-x, -y), a rotation by 180°180°, and the mirrors are 90°90° apart
• Reflect across y=xy = x, then y=xy = -x: a rotation by 180°180° as well, again from perpendicular mirrors
• Reflect across the 30°30° line, then the 60°60° line: a rotation by 60°60°, twice the 30°30° between the mirrors

The order matters: swapping the two reflections reverses the rotation. And the composition has determinant (1)(1)=+1(-1)(-1) = +1, which is why two orientation-reversing maps combine into an orientation-preserving one. The presets are chosen so that the pairs above can be tried by switching between them and reading off RvR\mathbf{v} for the same v\mathbf{v}.

Key Properties

Every reflection across a line through the origin shares the same algebra, whatever the angle.

• Involution: R2=IR^2 = I, so R1=RR^{-1} = R
• Symmetric and orthogonal: RT=RR^T = R and RTR=IR^T R = I
• Determinant 1-1: orientation reversing
• Trace 00: the eigenvalues +1+1 and 1-1 add to zero
• Eigenvectors: the mirror direction with eigenvalue 11, the perpendicular with eigenvalue 1-1
• Isometry: lengths, angles and areas are preserved; only orientation is flipped
• Relation to projection: R=2PIR = 2P - I, and P=12(I+R)P = \tfrac{1}{2}(I + R)
• Products: two reflections give a rotation by twice the angle between the mirrors; a rotation times a reflection is a reflection