Skip to content

5.1 — Rays, Reflection and Refraction

Put a straight stick into water and it looks bent at the surface. Look into a swimming pool and it seems shallower than it is. Watch a road on a hot day and there appears to be a puddle a hundred metres ahead that retreats as you approach.

All three are the same effect, and the effect has one cause: light travels at different speeds in different materials, and when it crosses a boundary at an angle, that change of speed bends it.

This chapter derives the two laws of ray optics — reflection and refraction — from a single principle about travel time, and then uses them on rainbows, mirages, fibre optics and the sparkle of a diamond.

Light slows down in matter

In vacuum, light travels at exactly c = 299{,}792{,}458 m/s, which Chapter 4.7 derived from \varepsilon_0 and \mu_0. In a transparent material it travels slower, and the factor by which it slows is the refractive index:

\boxed{n = \frac{c}{v}}

with n \geq 1 always. Some values for visible light:

Materialn
Vacuum1 exactly
Air1.0003
Water1.333
Glass (crown)1.52
Glass (flint)1.62
Diamond2.417

Why does it slow down? Not because the photons themselves travel slower — a photon always moves at c between interactions. What happens is that the light's oscillating electric field (Chapter 4.7) shakes the electrons in every atom it passes. Those shaken electrons radiate their own light waves. The original wave and all the re-radiated waves superpose, and the combination is a wave whose crests advance more slowly than the original would have. The result is a genuine reduction in the speed at which a wavefront moves through the material, and it emerges from a huge number of tiny scattering events.

What does not change is the frequency. The atoms are being driven at the incoming frequency and re-radiate at that same frequency, so light entering glass keeps its colour. Since v = f\lambda and v falls while f is fixed, the wavelength shrinks by the factor n:

\lambda_{\text{medium}} = \frac{\lambda_{\text{vacuum}}}{n}

Green light of 500 nm in air becomes 375 nm in water. This matters for Chapter 5.3, where interference depends on the wavelength inside a film.

Fermat's principle

Pierre de Fermat proposed in 1662 that light takes the path between two points that takes the least time. (More precisely, the path whose travel time is stationary — a minimum, maximum or saddle — but for everything in this chapter it is a minimum.)

This is a strikingly odd principle. It seems to say the light knows where it is going and has picked the fastest route in advance, which cannot be right. The modern justification comes from quantum mechanics: light explores every path, and the contributions from paths near the fastest one arrive in phase and reinforce, while contributions from other paths arrive with all different phases and cancel. Chapter 7.2 develops this. For now, take Fermat's principle as a rule that works and watch what it gives.

Reflection derived

mirrornormalABθ₁θ₂
Reflection. Light leaves A, meets the mirror, and reaches B. Of all the possible bounce points, the one light actually uses is the one that makes the total path shortest — which turns out to be the point where the two angles to the normal are equal.

Light leaves A, bounces off a flat mirror, and reaches B. Both A and B are in the same medium, so the speed is constant, and the least-time path is simply the shortest path.

Here is the classic trick, due to Heron of Alexandria around AD 60. Reflect point B through the mirror to get an image point B′ on the other side. For any bounce point P on the mirror, the distance PB equals the distance PB′ by symmetry. So the total path AP + PB equals AP + PB′.

The shortest AP + PB′ is a straight line from A to B′. So P must lie where the straight line A–B′ crosses the mirror.

Now read off the angles. The line from P to B′ makes some angle with the mirror, and since B′ is the mirror image of B, the line from P to B makes the same angle on the other side. And A, P, B′ being collinear means the incoming angle equals that angle too.

\boxed{\theta_{\text{incidence}} = \theta_{\text{reflection}}}

measured from the normal — the line perpendicular to the surface. Both rays and the normal lie in one plane.

Why the normal, and not the surface? Because the normal is defined for any surface, flat or curved, and the surface direction is not. A curved mirror has a different normal at every point, and the law still holds locally at each point, which is the whole theory of curved mirrors in Chapter 5.2.

A rough surface obeys the same law. Each microscopic facet reflects properly; the facets point in all directions, so the reflected light scatters everywhere. That is diffuse reflection, and it is why you can see this page from any angle while a mirror shows you only one thing at a time. The difference between a mirror and a matt white wall is nothing but surface roughness compared with the wavelength of light.

Refraction derived: the lifeguard problem

A ray crossing a boundary between two media, bending towards the normal on entering the denser medium, with the angles labelled
Refraction at a boundary. The ray bends towards the normal on entering the slower medium and away from it on leaving. The wavefronts in the picture show why: the part of the wave that enters first is slowed first, so the front pivots. Image: Wikimedia Commons.

Now the two points are in different media, so the shortest path is not the fastest one.

The standard way to see this is the lifeguard problem. A lifeguard on the beach must reach a swimmer in the water. They run at 8 m/s on sand and swim at 2 m/s. A straight line is the shortest route and it is not the fastest, because it spends too long in the water. The fastest route runs further along the beach and then cuts into the water at a steeper angle. The optimal path bends at the water's edge, towards the perpendicular, exactly as light does.

Do the calculus. Put the boundary along the x axis. A is at (0, a) in medium 1 where light goes at v_1; B is at (d, -b) in medium 2 where it goes at v_2. Light crosses at (x, 0).

T = \frac{\sqrt{a^2+x^2}}{v_1} + \frac{\sqrt{b^2+(d-x)^2}}{v_2}

Differentiate with respect to x and set to zero:

\frac{dT}{dx} = \frac{x}{v_1\sqrt{a^2+x^2}} - \frac{d-x}{v_2\sqrt{b^2+(d-x)^2}} = 0

Now look at what those two fractions are geometrically. In the first triangle, x is the side opposite the angle from the normal and \sqrt{a^2+x^2} is the hypotenuse, so the ratio is \sin\theta_1. Likewise the second is \sin\theta_2. So:

\frac{\sin\theta_1}{v_1} = \frac{\sin\theta_2}{v_2}

Substitute v = c/n:

\boxed{n_1\sin\theta_1 = n_2\sin\theta_2}

Snell's law, named for Willebrord Snellius who found it experimentally in 1621, though Ibn Sahl in Baghdad had it in 984 and it was forgotten. Fermat's principle produces it in half a page.

Read the law in words: going into a slower medium (n larger), the ray bends towards the normal. Going into a faster medium, it bends away.

Worked example: the stick in water

A stick enters water at 40° to the vertical. What angle does it appear to make below the surface?

Light travels from the submerged part of the stick up to your eye, going from water (n = 1.333) to air (n = 1.0):

1.333\sin\theta_w = 1.000\sin\theta_a

For the ray leaving at 40° from the normal in air:

\sin\theta_w = \frac{\sin 40°}{1.333} = \frac{0.6428}{1.333} = 0.4822 \quad\Longrightarrow\quad \theta_w = 28.8°

So light that reaches you at 40° actually came from a direction 28.8° below the surface, but your brain assumes light travels in straight lines and traces it back along the 40° direction. The submerged part appears displaced, and the stick looks bent at the surface.

Worked example: apparent depth

Look straight down into water of true depth h. Where does the bottom appear to be?

For small angles \sin\theta \approx \tan\theta, and Snell's law becomes n_1\tan\theta_1 \approx n_2\tan\theta_2. Two similar triangles with the same horizontal offset then give:

\frac{h_{\text{apparent}}}{h_{\text{real}}} = \frac{n_{\text{air}}}{n_{\text{water}}} = \frac{1}{1.333} = 0.75

The bottom looks three quarters as deep as it is. A pool marked 2.0 m looks 1.5 m deep. This is a genuine safety issue and it is why people misjudge diving into unfamiliar water. It is also why a fish appears closer to the surface than it is, which spear fishers learn to compensate for, and why an object in a glass of water looks displaced upward.

Total internal reflection

Go the other way — from a slow medium into a fast one, water into air. Snell's law says the ray bends away from the normal. Increase the angle inside the water and the refracted ray gets closer and closer to skimming along the surface.

At one particular angle, the refracted ray lies exactly along the surface, \theta_2 = 90°. Beyond it, Snell's law would need \sin\theta_2 > 1, which has no solution. There is no refracted ray at all. All the light reflects back inside.

The angle at which this starts is the critical angle:

n_1\sin\theta_c = n_2\sin 90° = n_2

\boxed{\sin\theta_c = \frac{n_2}{n_1}}

which only has a solution when n_1 > n_2 — light must be going from slower to faster.

Water to air:

\sin\theta_c = \frac{1.00}{1.333} = 0.750 \quad\Longrightarrow\quad \theta_c = 48.6°

Glass to air: \theta_c = \arcsin(1/1.52) = 41.1°.

Diamond to air: \theta_c = \arcsin(1/2.417) = 24.4°.

Underwater photograph of a turtle with its mirror-like reflection visible on the underside of the water surface
Total internal reflection photographed from underwater. Beyond the critical angle the surface behaves as a perfect mirror, so the turtle appears reflected in the underside of the water. Image: Wikimedia Commons.

Diamond's tiny critical angle is why diamonds sparkle. Light entering a cut diamond hits the back facets at angles well beyond 24°, so it cannot get out; it bounces around inside and eventually leaves through the top. A cutter's job is to choose facet angles that guarantee this, which is why a well-cut stone is brilliant and a badly cut one looks dull no matter how pure it is. Cubic zirconia, with n = 2.15 and \theta_c = 27.7°, imitates it fairly well; glass with \theta_c = 41° leaks light out of the back and looks like glass.

Looking up from underwater, everything above the surface is squeezed into a cone of half-angle 48.6° directly overhead — the whole 180° of sky compressed into a bright circle called Snell's window. Outside that circle you see the underside of the surface acting as a mirror, reflecting the bottom.

Optical fibre is total internal reflection in a wire.

Cross-sections of step-index and graded-index optical fibres showing light paths bouncing along the core
Optical fibre. A glass core is surrounded by cladding of slightly lower refractive index, so light entering within a small enough angle hits the boundary beyond the critical angle and cannot escape. Image: Wikimedia Commons.

The core has n \approx 1.4675 and the cladding n \approx 1.4622 — a difference of only 0.4 %, which gives a critical angle of 84.6° measured from the normal, meaning rays within 5.4° of the axis are trapped. Modern fibre loses only about 0.2 dB per kilometre, so light travels 50 km before dropping to a quarter of its power, which is why intercontinental cables need repeaters every 50–100 km rather than every 100 m. Volume III, Chapter 8.5 covers the communications engineering.

Note the difference from a metal mirror: a good mirror reflects about 95 % of light, so after twenty bounces only 36 % survives. Total internal reflection reflects 100.000 % — not "nearly all", but all, because there is no transmitted ray to carry energy away. That is why fibre works over thousands of kilometres and a pipe lined with mirrors would not.

Dispersion, and the rainbow

The refractive index is not one number. It depends on wavelength, because the electrons in the material respond differently to different driving frequencies (Chapter 4.7). For ordinary glass, n is larger for blue light than for red:

Colour\lambdan (crown glass)
Red656 nm1.5145
Yellow589 nm1.5175
Blue486 nm1.5230

Only about half a percent between red and blue, and it is enough. Blue bends more. So white light entering a prism at an angle fans out into a spectrum, with red deviated least and violet most.

Newton did this experiment in 1666 and, crucially, did the second half that nobody had done before: he took the spectrum, passed it through a second prism turned the other way, and recombined it into white light. That proved the prism was not adding colour to white light, as everyone had assumed, but separating colours that were already there.

The rainbow, worked out

Ray diagram of a light ray entering a spherical raindrop, reflecting once off the back, and leaving, with the total deviation marked
A ray in a raindrop. It refracts on entering, reflects once off the back surface, and refracts again on leaving. The total turn is close to 138° for every ray near the critical geometry, which is what concentrates the light into a bright arc. Image: Wikimedia Commons.

Sunlight enters a spherical raindrop, reflects once off the far inside surface, and refracts out again.

Track the deviation. Let the ray strike the drop at angle of incidence i and refract to angle r inside.

  • Entering: it turns by (i - r).
  • Reflecting off the back: it turns by (180° - 2r).
  • Leaving: it turns by (i - r) again.

D = 2(i-r) + 180° - 2r = 180° + 2i - 4r

Now the key step. Different rays hit the drop at different places, so i varies from 0° to 90°. If the deviation varied smoothly across that range, the light would smear out over the whole sky and there would be no rainbow.

It does not vary smoothly. D has a minimum, and near a minimum the function is flat — a large range of input angles gives almost the same output angle. So light piles up at that deviation, and that pile-up is the rainbow.

Find it. Differentiate with respect to i and set to zero:

\frac{dD}{di} = 2 - 4\frac{dr}{di} = 0 \quad\Longrightarrow\quad \frac{dr}{di} = \frac{1}{2}

From Snell's law, \sin i = n\sin r. Differentiate both sides:

\cos i = n\cos r\frac{dr}{di} = \frac{n\cos r}{2}

Square it and use \cos^2 = 1 - \sin^2 on both sides, together with \sin r = \sin i/n:

4(1-\sin^2 i) = n^2\left(1 - \frac{\sin^2 i}{n^2}\right) = n^2 - \sin^2 i

4 - 4\sin^2 i = n^2 - \sin^2 i \quad\Longrightarrow\quad 3\sin^2 i = 4 - n^2

\boxed{\sin i = \sqrt{\frac{4-n^2}{3}}}

For red light, n = 1.331:

\sin i = \sqrt{\frac{4-1.772}{3}} = \sqrt{\frac{2.228}{3}} = \sqrt{0.7427} = 0.8618 \quad\Longrightarrow\quad i = 59.5°

\sin r = \frac{0.8618}{1.331} = 0.6475 \quad\Longrightarrow\quad r = 40.4°

D = 180 + 2(59.5) - 4(40.4) = 180 + 119.0 - 161.5 = 137.5°

The angle from the antisolar point — the point directly opposite the Sun, which is where the shadow of your head falls — is 180° - 137.5° = 42.5°.

For violet light, n = 1.344: the same arithmetic gives i = 58.8°, r = 39.6°, D = 139.3°, so the angle is 40.7°.

\boxed{\text{Red at }42.5°,\quad \text{violet at }40.7°}

Both measured from the direction of your own shadow. That is the rainbow, and now several things about it make sense.

It is always a circle centred on your shadow, because the geometry depends only on the angle from the antisolar point. You see an arc rather than a full circle because the ground gets in the way; from an aircraft you can see the whole ring.

Red is on the outside, because red comes back at the larger angle.

Nobody else sees your rainbow. Each person's rainbow is made of different drops, since it is defined relative to their own shadow. Two people standing side by side see two different rainbows.

You cannot reach it. Walk towards it and the geometry moves with you.

The sky is brighter inside the arc than outside. Rays with other angles of incidence all emerge at deviations greater than 137.5°, meaning at angles less than 42° from the antisolar point. So light fills the disc inside the bow and there is none outside — an effect called Alexander's dark band, described by Alexander of Aphrodisias around AD 200.

The secondary bow comes from rays that reflect twice inside the drop. The same analysis gives a minimum deviation putting it at about 51°, with the colours reversed because of the extra reflection, and it is fainter because each internal reflection leaks some light out.

Mirages

Hot ground heats the air just above it, and hot air is less dense, so its refractive index is slightly smaller — about 1.00026 at 50 °C against 1.00029 at 15 °C.

Light from the sky travelling downwards at a shallow angle enters progressively less dense air and bends progressively away from the vertical. This is refraction happening continuously rather than at a single boundary, and if the gradient is strong enough the ray curves until it is travelling horizontally and then curves back up. Effectively it has been totally internally reflected by a layer of air.

You see sky light coming from a direction below the horizon, and your brain interprets it as a reflection in a puddle. That is the inferior mirage on a hot road, and it retreats as you approach because it depends on grazing angles that only exist at a distance.

The reverse happens over cold surfaces. Cold air near the ground with warmer air above bends light downwards, so you can see objects that are actually below the horizon. This is the superior mirage, and it lets ships be seen over the curve of the Earth. In extreme form, over Arctic water, it produces the Fata Morgana, where distant coastlines appear as towering cliffs and castles. Many old reports of phantom islands were this.

Twilight lasts longer than it should for the same reason. Atmospheric refraction lifts the apparent position of the Sun by about 0.6° at the horizon, which is slightly more than the Sun's own diameter. So at the moment the Sun appears to be touching the horizon, it is geometrically already fully below it. Every sunset you have ever watched was already over.

Where this shows up in your life

Your glasses, your camera, your phone's lens and your eye all work on Snell's law, and Chapter 5.2 turns it into the lens equation.

Endoscopes and keyhole surgery exist because a bundle of fibres carries an image along a bent path. Fibre also lights the interior, so nothing hot goes inside the patient.

Retroreflectors — on road signs, bicycle reflectors and cats' eyes — use either three mirrors at right angles or a glass sphere, and send light back exactly the way it came regardless of the angle. The Apollo missions left arrays of them on the Moon, and laser ranging off those arrays measures the Earth–Moon distance to a few millimetres, which is how we know the Moon is receding at 3.8 cm per year.

Fibre-optic internet. Nearly every long-distance data connection on the planet is a glass thread relying on the critical angle calculation above.

A swimming pool looks shallower, a straw looks broken, and the Sun sets before you see it set. All Snell.

What the next chapter fixes

Snell's law tells you what a single ray does at a single flat surface. It does not tell you what happens when a great many rays from one point strike a curved surface and are all bent by different amounts — which is what a lens or a mirror does, and whether they end up meeting again at a single point is the whole question of image formation. Chapter 5.2 derives the mirror and lens equations from Snell's law and simple geometry, explains what makes a real image different from a virtual one, and shows exactly what a pair of glasses does to fix a short-sighted eye.