Sub topic 2
The law of reflection
This chapter gives the rule that fixes the direction of a reflected ray, in both angle and vector form. It also covers the common ways the rule is misapplied. It assumes you can measure angles, use sine and inverse sine, and treat light as a ray (a line along which light energy travels). It also assumes you have seen the idea of a surface normal from the previous chapter. We stay with flat, smooth surfaces here. Rough surfaces are the next chapter, and the reason behind the law (Fermat's principle) comes later.
The statement of the law
A ray that hits a surface is the incident ray. The ray that leaves the surface on the same side is the reflected ray. The normal is the line perpendicular to the surface at the point where the ray lands, called the point of incidence.
The law of reflection has two parts:
- The angle of reflection equals the angle of incidence: θr = θi.
- The incident ray, the reflected ray, and the normal all lie in one plane. This plane is the plane of incidence.
Both angles are measured from the normal, not from the surface. A ray that arrives along the normal has θi = 0° and returns along the same line. A ray that skims the surface has θi close to 90°.
The second part is easy to forget, but it matters. Equal angles alone allow many directions: any ray on a cone around the normal makes the same angle with it. The coplanarity condition picks exactly one of them. The reflected ray lies on the opposite side of the normal from the incident ray, within the same plane.
Measuring from the normal
The most common error in reflection problems is measuring from the surface instead of the normal. Suppose a problem says a ray strikes a mirror at 30° to the mirror. That 30° is the glancing angle. The angle of incidence is 90° − 30° = 60°. The reflected ray leaves at 60° from the normal, which is 30° from the mirror.
| Given | Angle of incidence θi | Angle of reflection θr | Angle between reflected ray and mirror |
|---|---|---|---|
| Ray at 0° to the normal | 0° | 0° | 90° |
| Ray at 30° to the normal | 30° | 30° | 60° |
| Ray at 30° to the mirror | 60° | 60° | 30° |
| Ray at 85° to the normal | 85° | 85° | 5° |
The angle between the incident and reflected rays is 2θi. The ray is deflected from its original path by 180° − 2θi.
Why the law holds
Treat the incoming light as a wave with flat wavefronts, as in the first chapter. The wavefront reaches the surface edge first, so that part starts to spread out as a new wave before the rest of the front arrives. The reflected wavefront is the envelope of these spreading waves. Because the speed does not change (the light stays in the same medium), the geometry works out to equal angles from the normal. The full derivation using Huygens' construction is not needed here. The result is a property of waves meeting a smooth, flat boundary.
The law also follows from Fermat's principle: the actual path between two points is the one of least travel time. We return to this in a later chapter, where it also explains refraction.
Two further facts follow directly from the law:
- Reversibility. If you reverse a reflected ray, it retraces the incident path. Swapping the source and the observer gives the same path.
- Independence from color. The angle does not depend on wavelength. A mirror reflects red and blue light at the same angle. (Refraction behaves differently, as the dispersion chapter shows.)
The vector form
Angles are fine for sketches. In code, and in problems with tilted surfaces in three dimensions, a vector form is cleaner. Let d be the direction of the incident ray and n be a unit normal (length 1). The reflected direction is
r = d − 2(d·n)n
The dot product d·n is the component of d along the normal. The formula subtracts that component twice, which flips it while leaving the part parallel to the surface unchanged. That is exactly what a mirror does.
The vector form handles the coplanarity condition automatically. The result is a combination of d and n, so it must lie in the plane that contains them.
Here is a version that normalizes the normal for you and checks the law numerically.
import math
def normalize(v):
length = math.hypot(v[0], v[1])
return (v[0] / length, v[1] / length)
def reflect(d, n):
"""Reflect direction vector d off a surface with normal n (2D tuples)."""
n = normalize(n)
dot = d[0] * n[0] + d[1] * n[1]
return (d[0] - 2 * dot * n[0], d[1] - 2 * dot * n[1])
def angle_from_normal(v, n):
"""Angle in degrees between the line of v and the line of the normal."""
v = normalize(v)
n = normalize(n)
c = abs(v[0] * n[0] + v[1] * n[1])
return math.degrees(math.acos(min(1.0, c)))
d = (1, -1) # travelling right and down
n = (0, 1) # horizontal mirror, normal points up
r = reflect(d, n)
print(r)
print(round(angle_from_normal(d, n), 2), round(angle_from_normal(r, n), 2))The output is (1.0, 1.0) followed by 45.0 45.0. The ray leaves right and up, and both angles are 45° from the normal.
Gotchas in the vector form
- The normal must have length 1. If you pass n = (0, 2) to the raw formula r = d − 2(d·n)n without normalizing, the dot product and the correction term both scale wrongly, and the output length changes. The function above normalizes for you.
- The sign of n does not matter. The formula uses n twice, so flipping n to −n gives the same r. You do not need the normal to point toward the incoming ray.
- Length is preserved. |r| = |d|. If your reflected vector gets longer or shorter, the normal was not a unit vector.
- In three dimensions the formula is unchanged. Only the dot product gains a third term.
Consequences you can use
Reflection in a plane mirror
A plane mirror forms an image of a point source that appears to sit behind the mirror. The image is the same distance behind the mirror as the object is in front, and on the same perpendicular line. To see why, trace two rays from the source to the mirror and extend the reflected rays backward. By the law, they appear to diverge from a single point on the far side. Light does not actually pass through that point, so the image is called a virtual image. It cannot be projected on a screen placed there.
The image is also laterally inverted in the sense that the mirror swaps front and back, not left and right. The mirror reverses the component of position along its normal and leaves the other components unchanged.
Rotating a mirror
If you rotate a mirror by an angle α while the incident ray stays fixed, the normal rotates by α, so θi changes by α. The reflected ray's angle from the normal changes by α too, in the same sense relative to the normal. Measured from the original direction, the reflected ray turns by 2α.
This doubling is used in measuring devices. A small mirror tilt becomes a large movement of a light spot across a distant scale, as in a mirror galvanometer or a laser pointer scanning a pattern. The code below confirms it.
import math
def reflect(d, n):
dot = d[0] * n[0] + d[1] * n[1]
return (d[0] - 2 * dot * n[0], d[1] - 2 * dot * n[1])
def rotate(v, deg):
a = math.radians(deg)
return (v[0] * math.cos(a) - v[1] * math.sin(a),
v[0] * math.sin(a) + v[1] * math.cos(a))
def heading(v):
return math.degrees(math.atan2(v[1], v[0]))
d = (0, -1) # ray travelling straight down
n0 = (0, 1) # unit normal of a horizontal mirror
for tilt in (0, 10, 20):
n = rotate(n0, tilt)
r = reflect(d, n)
print(tilt, round(heading(r), 1))The output is:
0 90.0
10 110.0
20 130.0Each 10° of mirror tilt moves the reflected ray by 20°.
Two mirrors at right angles
Reflect a ray off a horizontal mirror, then off a vertical one. The first reflection flips the vertical component of the direction, and the second flips the horizontal component. The ray emerges with direction (−dx, −dy), which is exactly opposite to the incoming direction, so it travels back parallel to its path. This holds for any incoming angle, provided the ray hits both mirrors and the mirrors are perpendicular. Three mutually perpendicular mirrors do the same in three dimensions. That arrangement, a corner reflector, is used in bicycle reflectors and in the retroreflectors left on the Moon.
Common errors
| Error | What goes wrong | Fix |
|---|---|---|
| Measuring angles from the surface | Uses 90° − θi in place of θi | Draw the normal first |
| Treating equal angles as the whole law | Ignores which side of the normal the ray leaves on | Keep the ray in the plane of incidence, on the opposite side of the normal |
| Using a non-unit normal in r = d − 2(d·n)n | Output has the wrong length and direction | Normalize n first |
| Expecting the normal to point at the source | Sign confusion | The formula works for either sign of n |
| Assuming the law needs a perfectly flat mirror | Curved surfaces seem to break the law | Apply the law at each point, using the local normal |
The last row is worth remembering. The law is local. On a curved mirror, you find the normal at the exact point where the ray lands and apply the same rule. A curved mirror changes where rays go because its normal changes from point to point, not because the law is different.
Exercises
Exercise
A ray strikes a flat mirror so that it makes an angle of 25° with the mirror surface. What are the angle of incidence, the angle of reflection, and the angle between the incident and reflected rays?
Show answer
The angle of incidence is measured from the normal, so θi = 90° − 25° = 65°. By the law of reflection, θr = 65°. The angle between the incident and reflected rays is 2 × 65° = 130°, which you can check as 180° − 2 × 25° = 130°.
Exercise
Use r = d − 2(d·n)n to find the reflected direction for d = (3, −4) hitting a wall whose unit normal is n = (−1, 0). Does the length of the vector change?
Show answer
d·n = (3)(−1) + (−4)(0) = −3. Then r = (3, −4) − 2(−3)(−1, 0) = (3, −4) − (6, 0) = (−3, −4). The horizontal component flips and the vertical component stays the same, which is what a vertical wall should do. The length is 5 before and after, so it does not change.
Exercise
A laser beam hits a small mirror and lands on a wall 4 m away, at a spot directly in line with the beam when the mirror is flat. You tilt the mirror by 1.5°. By what angle does the reflected beam turn, and roughly how far does the spot move on the wall?
Show answer
The reflected beam turns by twice the mirror's tilt, so 3°. The spot moves about 4 m × tan(3°) ≈ 4 × 0.0524 ≈ 0.21 m, or about 21 cm.