On this page
Most students find a reflected ray by drawing: sketch the normal, copy the angle across. That breaks down when the mirror sits at an awkward angle, or the question gives a plane like 2x − y + 2z = 5 and a ray in 3D. Vectors handle every case with one line.
What does r = d − 2(d·n)n actually do?
The law of reflection says the angle of reflection equals the angle of incidence, both measured from the normal, the line perpendicular to the surface (OpenStax University Physics, Volume 3). The incident direction, the normal and the reflected direction also lie in one plane (Wikipedia: Specular reflection).
The vector form of that law is r = d − 2(d·n)n, where d is the incident direction, n is a unit normal to the mirror and r is the reflected direction (Wolfram MathWorld: Reflection).
Split d into a part along the mirror and a part along the normal. The normal part is (d·n)n, the projection of d on n (this explainer on the projection of a vector covers it). The mirror keeps the first part and reverses the second. Subtracting the normal part once removes it; subtracting it twice reverses it.
So r has the same length as d, and it does not matter which way n points: swap n for −n and (d·n)n stays the same.
How do you find the reflected ray direction step by step?
Write the incident direction d as a vector, pointing the way the light travels. It need not be a unit vector.
Find a normal to the mirror. In 2D, a mirror at angle α to the x-axis has normal (−sin α, cos α). In 3D, the plane ax + by + cz = k has normal (a, b, c).
Make the normal a unit vector by dividing by its length.
Compute the dot product d·n.
Compute r = d − 2(d·n)n.
Check that the length of r equals the length of d, and that r·n = −(d·n).
What is the reflected direction for a 30° mirror?
A horizontal ray travels along d = (1, 0) and strikes a plane mirror at 30° to the x-axis.
Unit normal: n = (−sin 30°, cos 30°) = (−1/2, √3/2).
Dot product: d·n = −1/2.
Reflected direction: r = (1, 0) − 2(−1/2)(−1/2, √3/2) = (1, 0) + (−1/2, √3/2) = (1/2, √3/2).
The reflected ray leaves at 60° to the x-axis. The diagram at the top shows this case: the dashed arrow is where d would have gone, and the pink arrow, −2(d·n)n, bends it onto r.
Why does rotating the mirror by θ turn the ray by 2θ?
Repeat the example with the mirror at 45°. Now n = (−1/√2, 1/√2), d·n = −1/√2, and r = (1, 0) + (−1, 1) = (0, 1): straight up, at 90°.
For any mirror angle α, d·n = −sin α, so r = (1 − 2sin²α, 2 sin α cos α) = (cos 2α, sin 2α). The ray's angle is always twice the mirror's: turning the mirror 15° (30° to 45°) swung the ray 30° (60° to 90°). We work through the classic version in why a rotating plane mirror turns the ray by 2θ.
How do you reflect a ray off a plane in 3D?
A ray travels along d = (1, 2, −3) and meets the mirror plane 2x − y + 2z = 5.
Normal: N = (2, −1, 2), with length 3, so n = (2/3, −1/3, 2/3).
Dot product: d·n = (2 − 2 − 6)/3 = −2.
Reflected direction: r = d + 4n = (1 + 8/3, 2 − 4/3, −3 + 8/3) = (11/3, 2/3, −1/3).
The direction ratios are 11 : 2 : −1. Check: d·d = 14 and r·r = (121 + 4 + 1)/9 = 14, and r·n = 2 = −(d·n). The 5 never appears: it fixes where the mirror is, not which way it faces. To write the reflected ray as a line you also need the point of incidence; for a 2D version, see the equation of a reflected ray from the x-axis.
What mistakes give the wrong reflected ray?
Taking d from the mirror back to the source, instead of the way the light travels.
Using a vector along the mirror instead of the normal.
Writing + 2(d·n)n. The sign is minus.
Dropping the 2: d − (d·n)n is the part along the mirror, not the reflection.
If your answer keeps coming out wrong, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. If dot products are the real gap, the Fermi Concept Library gives each concept its own lesson.
Try one now: reflect d = (0, 0, −1) off the plane x + y + z = 0, then run both checks. You should get (2, 2, −1)/3.



