PHYS-230 · Lesson 11 of 12 · 26 min

Geometrical optics: reflection, refraction, lenses and mirrors

When the wavelength is tiny compared with everything it meets, diffraction is negligible and light can be treated as rays travelling in straight lines, bending only where the medium changes. This is geometrical optics, the short-wavelength limit of wave optics, and it is the working language of anyone who designs lenses, cameras, endoscopes or headlamps. This lesson derives the laws of reflection and refraction from Fermat's principle, explains total internal reflection, prisms and rainbows, develops the imaging equations for spherical surfaces, thin lenses and mirrors with a consistent sign convention, and then introduces the matrix method that turns the design of a multi-element system into multiplication of two-by-two matrices. It closes with the aberrations that make real lenses imperfect and how designers correct them.

Rays and Fermat's principle

A ray is the path along which light energy travels, perpendicular to the wavefronts in an isotropic medium. Pierre de Fermat stated in 1662 that light travels between two points along the path of stationary optical path length \(\int n\,ds\), usually the path of least time. In a uniform medium that is a straight line. For reflection from a mirror, the shortest path from A to the mirror to B makes equal angles with the normal: the angle of incidence equals the angle of reflection, found by reflecting B in the mirror and drawing a straight line.

For refraction, let a ray go from point A in medium 1 (index \(n_1\)) to point B in medium 2 (index \(n_2\)), crossing the flat boundary at position \(x\). The optical path is \(n_1\sqrt{a^2 + x^2} + n_2\sqrt{b^2 + (d - x)^2}\), where \(a\) and \(b\) are the distances of A and B from the boundary and \(d\) their horizontal separation. Setting its derivative with respect to \(x\) to zero gives \(n_1 x/\sqrt{a^2 + x^2} = n_2(d - x)/\sqrt{b^2 + (d - x)^2}\), which is

\[n_1\sin\theta_1 = n_2\sin\theta_2.\]

This is Snell's law, named for Willebrord Snellius, who found it in 1621, though Ibn Sahl described it in Baghdad around 984 and René Descartes published it in 1637. Light bends toward the normal entering a denser medium, which is why a straw looks broken at the water surface and a pool looks shallower than it is: seen from directly above, a depth \(h\) appears as \(h/n\), three quarters of the true depth for water.

Total internal reflection

Going from a higher to a lower index, \(\sin\theta_2 = (n_1/n_2)\sin\theta_1\) reaches 1 at the critical angle

\[\sin\theta_c = \frac{n_2}{n_1}.\]

Beyond it no refracted ray exists and all the light reflects, with no loss at all, better than any metal mirror. For glass to air \(\theta_c = 41.8^\circ\), so a \(45^\circ\) prism reflects light through a right angle; binoculars use pairs of such prisms to fold their light path and erect the image. For diamond, \(n = 2.42\) gives \(\theta_c = 24.4^\circ\), and the brilliant cut traps light by repeated internal reflection before it exits through the top. Optical fibres guide light by total internal reflection at the boundary between a core and a cladding of slightly lower index; lesson 12 returns to them. The reflected wave is not quite confined: an evanescent field leaks a fraction of a wavelength into the second medium, and if another dense medium is brought that close, light tunnels across, frustrated total internal reflection, which is used in some beam splitters and fingerprint sensors.

Prisms, dispersion and rainbows

A prism with apex angle \(A\) deviates a ray by an angle \(\delta\) that is smallest when the ray passes symmetrically, giving \(n = \sin\frac{A + \delta_{\min}}{2}/\sin\frac A2\), the standard way to measure refractive index. Because \(n\) varies with wavelength, the deviation does too, and white light fans into a spectrum, as Newton showed in 1666 with his prism experiments, recombining the spectrum with a second prism to prove that the hues were in the sunlight, not made by the glass.

A rainbow is dispersion by raindrops. Sunlight enters a spherical drop, reflects once from the back, and exits. The total deviation depends on where the ray enters, and it has a minimum, near which many rays bunch together and the outgoing light is concentrated. For water, the minimum deviation is about \(138^\circ\), so the bow appears at \(42^\circ\) from the point directly opposite the Sun, red on the outside because red has the smaller index. Two internal reflections give the fainter secondary bow at about \(51^\circ\), with the order of hues reversed. Descartes worked out the \(42^\circ\) by tracing rays through a water-filled glass globe in 1637, and the program below repeats his calculation.

Imaging by a spherical surface

A spherical refracting surface of radius \(R\) separating indices \(n_1\) and \(n_2\) forms an image. We use the convention that light travels left to right; object distances \(s\) are positive for real objects to the left of the surface, image distances \(s'\) positive for real images to the right, and \(R\) positive when the centre of curvature is to the right. For paraxial rays, those close to the axis and at small angles, applying Snell's law with small-angle approximations gives

\[\frac{n_1}{s} + \frac{n_2}{s'} = \frac{n_2 - n_1}{R}.\]

A thin lens is two such surfaces close together. Applying the formula twice, the image of the first surface serving as the object for the second, gives the thin-lens equation and the lensmaker's formula for a lens of index \(n\) in air:

\[\frac1s + \frac1{s'} = \frac1f, \qquad \frac1f = (n - 1)\Big(\frac1{R_1} - \frac1{R_2}\Big).\]

The lateral magnification is \(m = -s'/s\); a negative \(m\) means an inverted image. A converging lens has \(f > 0\). With the object outside the focal length it forms a real, inverted image; inside the focal length it forms a virtual, upright, magnified image on the same side as the object, which is how a magnifying glass works. A diverging lens, \(f < 0\), always forms a virtual, upright, reduced image. Optometrists measure lens strength in dioptres, \(P = 1/f\) in reciprocal metres, because the powers of thin lenses in contact add.

A spherical mirror of radius \(R\) has focal length \(f = R/2\) and obeys the same equation \(1/s + 1/s' = 1/f\), with the convention that a concave mirror, which converges light, has \(f > 0\) and real images form in front of it. Mirrors have no chromatic aberration, because reflection does not depend on wavelength, which is why all large astronomical telescopes use mirrors.

Three ray diagrams. Top left: a converging lens with an object outside the focal length, three principal rays meeting to form a real inverted image on the far side. Top right: the same lens with the object inside the focal length, rays diverging after the lens and traced back as dashed lines to an upright virtual image behind the object. Bottom: a concave mirror with an object beyond the centre of curvature forming a real inverted reduced image between the centre and the focus.
Principal-ray diagrams: a converging lens forming a real image (\(s > f\)) and a virtual image (\(s < f\)), and a concave mirror forming a real image. The parallel ray passes through the focus; the central ray is undeviated; the focal ray emerges parallel.

Worked problem

A camera lens

A camera lens of focal length 50 mm photographs a person 1.80 m tall standing 4.0 m away. Where must the sensor be, and how tall is the image?

Show solution
  1. \(1/s' = 1/50 - 1/4000\), so \(s' = 50.63\ \mathrm{mm}\): the lens must move 0.63 mm away from its infinity setting.
  2. \(m = -s'/s = -50.63/4000 = -0.0127\).
  3. Image height \(1800 \times 0.0127 = 22.8\ \mathrm{mm}\), inverted.

Answer: The sensor sits 50.6 mm behind the lens and the image is 22.8 mm tall, which fills most of the 24 mm height of a full-frame sensor in portrait orientation. Focusing a camera means moving the lens by fractions of a millimetre.

The matrix method

Tracing many surfaces by repeated use of the imaging equation is tedious. The paraxial matrix method describes a ray at any plane by its height \(y\) and angle \(u\) to the axis, and each element of a system by a two-by-two matrix acting on \((y, u)\). With heights in metres, angles in radians and a medium of index 1 between elements, the two basic matrices are

\[T(d) = \begin{pmatrix} 1 & d \\ 0 & 1 \end{pmatrix}, \qquad L(f) = \begin{pmatrix} 1 & 0 \\ -1/f & 1 \end{pmatrix},\]

for travel through a distance \(d\), which changes the height by \(du\) but not the angle, and for a thin lens, which changes the angle by \(-y/f\) but not the height. A whole system is the product of its matrices in reverse order of travel, \(M = \begin{pmatrix} A & B \\ C & D \end{pmatrix}\), with determinant 1 when the input and output media are the same. Its effective focal length is \(f = -1/C\). The system images an input plane onto an output plane exactly when \(B = 0\), because then the output height \(y' = Ay\) does not depend on the input angle, and the magnification is \(A\).

For two thin lenses separated by \(d\), \(M = L(f_2)T(d)L(f_1)\), and multiplying out gives \(C = -(1/f_1 + 1/f_2 - d/f_1f_2)\), so

\[\frac1f = \frac1{f_1} + \frac1{f_2} - \frac{d}{f_1f_2}.\]

Two lenses in contact add powers; separating them changes the result in a way the formula captures. A telephoto lens uses a converging front group and a diverging rear group to get a long focal length in a short barrel. The matrix method handles thick lenses too, with a refraction matrix for each surface, and it identifies the principal planes, the two planes from which the thin-lens equation holds for the whole system. Optical design software uses exactly these products for first-order layout, before tracing exact rays to evaluate aberrations.

Worked problem

A two-lens system

Lenses of focal length \(+100\ \mathrm{mm}\) and \(-50\ \mathrm{mm}\) are 60 mm apart. Find the effective focal length and where light from a distant object focuses.

Show solution
  1. \(1/f = 1/100 - 1/50 + 60/5000 = 0.010 - 0.020 + 0.012 = 0.002\ \mathrm{mm^{-1}}\), so \(f = 500\ \mathrm{mm}\).
  2. The first lens alone would focus at 100 mm, which is 40 mm beyond the second lens: a virtual object at \(s = -40\ \mathrm{mm}\) for the second lens.
  3. \(1/s' = 1/f_2 - 1/s = -1/50 + 1/40 = 0.005\), so \(s' = 200\ \mathrm{mm}\) behind the second lens.

Answer: A 500 mm focal length with the image only 260 mm behind the front lens: a telephoto lens, whose length is about half its focal length.

Aberrations

The paraxial equations are approximations. Real lenses with spherical surfaces suffer aberrations. In spherical aberration, rays through the edge of a lens focus closer than rays near the axis. Coma and astigmatism blur off-axis points, field curvature bends the image surface, and distortion stretches the image toward the corners (pincushion) or shrinks it (barrel). Chromatic aberration arises because \(n\), and so \(f\), depends on wavelength: a simple lens focuses blue closer than red. In 1758 John Dollond patented the achromatic doublet, already made privately by Chester Moor Hall around 1733, which cements a converging crown-glass lens to a diverging flint-glass lens. Flint glass has higher dispersion, so a weaker diverging flint element can cancel the chromatic spread of a stronger converging crown element while leaving net converging power. The condition for two thin lenses in contact is \(\frac{1}{f_1V_1} + \frac{1}{f_2V_2} = 0\), where \(V\) is each glass's Abbe number, a measure of how little it disperses; Ernst Abbe introduced it while working with Carl Zeiss in the 1870s. Modern camera lenses with a dozen elements, aspheric surfaces and low-dispersion glasses correct all these aberrations to well below the size of a pixel.

Computing with rays

The program applies Snell's law and the critical angle, computes the rainbow angle by minimizing the deviation over impact parameter for red and violet light, verifies the lensmaker formula, traces the two-lens example with matrices, and designs an achromatic doublet.

Critical angles, rainbow angles, the lensmaker formula, ray matrices and an achromat
import math

# 1. critical angles
for name, n in (("water", 1.333), ("glass", 1.50), ("diamond", 2.42)):
    print(f"critical angle {name:7s}: {math.degrees(math.asin(1/n)):.1f} deg")

# 2. rainbow: deviation D = 180 + 2i - 4r for one internal reflection; minimize over incidence i
def rainbow(n, k=1):
    best = None
    for j in range(1, 9000):
        i = math.radians(j / 100)
        r = math.asin(math.sin(i) / n)
        D = k * 180 + 2 * math.degrees(i) - 2 * (k + 1) * math.degrees(r)
        if best is None or D < best: best = D
    return best
for label, n in (("red 700 nm", 1.331), ("violet 400 nm", 1.343)):
    D1, D2 = rainbow(n, 1), rainbow(n, 2)
    print(f"{label}: primary bow at {180 - D1:.1f} deg, secondary at {D2 - 180:.1f} deg from the antisolar point")

# 3. lensmaker: biconvex lens, n = 1.52, R1 = +100 mm, R2 = -100 mm
f = 1 / ((1.52 - 1) * (1/100 - 1/(-100)))
print(f"\nlensmaker f = {f:.1f} mm")

# 4. matrix method for the two-lens example (mm)
mul = lambda A, B: [[A[0][0]*B[0][0] + A[0][1]*B[1][0], A[0][0]*B[0][1] + A[0][1]*B[1][1]],
                    [A[1][0]*B[0][0] + A[1][1]*B[1][0], A[1][0]*B[0][1] + A[1][1]*B[1][1]]]
T = lambda d: [[1, d], [0, 1]]
Lf = lambda f: [[1, 0], [-1/f, 1]]
M = mul(Lf(-50), mul(T(60), Lf(100)))
print(f"system matrix A={M[0][0]:.3f} B={M[0][1]:.1f} C={M[1][0]:.5f} D={M[1][1]:.3f}, det = {M[0][0]*M[1][1]-M[0][1]*M[1][0]:.6f}")
print(f"effective focal length = {-1/M[1][0]:.1f} mm")
back = -M[0][0] / M[1][0]           # parallel input ray: distance after lens 2 to cross the axis
print(f"back focal distance = {back:.1f} mm")
# imaging check with the camera example: object 4000 mm before a 50 mm lens
s = 4000; sp = 1 / (1/50 - 1/s)
Mi = mul(T(sp), mul(Lf(50), T(s)))
print(f"camera: s' = {sp:.2f} mm, B element = {Mi[0][1]:.2e} (zero means imaging), magnification A = {Mi[0][0]:.4f}")

# 5. achromatic doublet, total f = 100 mm, crown V = 64.2, flint V = 36.4
V1, V2, F = 64.2, 36.4, 100.0
P = 1 / F
P1 = P * V1 / (V1 - V2); P2 = -P * V2 / (V1 - V2)
print(f"\nachromat: crown f1 = {1/P1:.1f} mm, flint f2 = {1/P2:.1f} mm, check 1/(f1 V1) + 1/(f2 V2) = {P1/V1 + P2/V2:.2e}")
Output
critical angle water  : 48.6 deg
critical angle glass  : 41.8 deg
critical angle diamond: 24.4 deg
red 700 nm: primary bow at 42.4 deg, secondary at 50.4 deg from the antisolar point
violet 400 nm: primary bow at 40.6 deg, secondary at 53.5 deg from the antisolar point

lensmaker f = 96.2 mm
system matrix A=0.400 B=60.0 C=-0.00200 D=2.200, det = 1.000000
effective focal length = 500.0 mm
back focal distance = 200.0 mm
camera: s' = 50.63 mm, B element = 0.00e+00 (zero means imaging), magnification A = -0.0127

achromat: crown f1 = 43.3 mm, flint f2 = -76.4 mm, check 1/(f1 V1) + 1/(f2 V2) = 0.00e+00

The rainbow calculation reproduces Descartes: the primary bow at about \(42^\circ\) for red and slightly less for violet, so red is outside, and the secondary bow near \(51^\circ\) with the order reversed. The matrix product gives the 500 mm focal length and the 200 mm back focal distance of the worked example, with determinant 1, and the camera matrix has \(B = 0\), confirming that the sensor plane is conjugate to the object. The achromat needs a crown element of about 43 mm focal length and a flint element of about \(-76\ \mathrm{mm}\).

Common mistakes

  • MistakeMixing sign conventions between equations.

    InsteadChoose one convention (here: real objects and images positive, \(R\) positive with centre to the right) and apply it to every quantity.

  • MistakeForgetting that a virtual image from a diverging lens has a negative image distance.

    Instead\(s' < 0\) means the image is on the same side as the object and cannot be projected.

  • MistakeExpecting total internal reflection going from low to high index.

    InsteadIt occurs only from higher to lower index, beyond \(\sin\theta_c = n_2/n_1\).

  • MistakeMultiplying ray matrices in the order the light meets the elements.

    InsteadWrite the product with the first element on the right: \(M = M_N\cdots M_2M_1\).

  • MistakeThinking an achromatic doublet removes all chromatic error.

    InsteadIt brings two wavelengths to a common focus; a small secondary spectrum remains unless special glasses are used.

Summary and key terms

  • Fermat's principle of stationary optical path gives the law of reflection and Snell's law \(n_1\sin\theta_1 = n_2\sin\theta_2\).
  • Beyond \(\sin\theta_c = n_2/n_1\) light is totally internally reflected; dispersion in raindrops makes rainbows at about \(42^\circ\) and \(51^\circ\).
  • A refracting surface obeys \(n_1/s + n_2/s' = (n_2 - n_1)/R\); thin lenses and mirrors obey \(1/s + 1/s' = 1/f\) with \(m = -s'/s\).
  • Ray matrices \(T(d)\) and \(L(f)\) multiply to give a system matrix; \(f = -1/C\) and imaging requires \(B = 0\).
  • Real lenses have spherical, off-axis and chromatic aberrations; achromatic doublets pair crown and flint glass.
Fermat's principle
Light follows a path of stationary optical path length between two points.
critical angle
The angle of incidence beyond which light is totally internally reflected.
paraxial approximation
Treating rays as close to the axis and at small angles so that sines equal angles.
dioptre
The unit of lens power, one over the focal length in metres.
ray transfer matrix
A two-by-two matrix that maps the height and angle of a ray through an optical element.
chromatic aberration
Variation of focal length with wavelength caused by dispersion.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A coin lies under 1.20 m of water. How deep does it appear from directly above?

    Show answer

    \(1.20/1.333 = 0.90\ \mathrm{m}\).

  2. An object is 15 cm in front of a lens with \(f = 10\ \mathrm{cm}\). Find the image distance and magnification.

    Show answer

    \(1/s' = 1/10 - 1/15 = 1/30\), \(s' = 30\ \mathrm{cm}\), \(m = -2\): real, inverted, twice the size.

  3. The same lens with the object 6.0 cm away.

    Show answer

    \(1/s' = 1/10 - 1/6 = -1/15\), \(s' = -15\ \mathrm{cm}\), \(m = +2.5\): virtual, upright, magnified.

  4. A plano-convex lens of index 1.50 has a curved surface of radius 25 cm. Find its power.

    Show answer

    \(1/f = 0.50(1/0.25 - 0) = 2.0\ \mathrm{m^{-1}}\): 2 dioptres, \(f = 50\ \mathrm{cm}\).

  5. A concave mirror has \(R = 40\ \mathrm{cm}\). Where is the image of an object 30 cm away?

    Show answer

    \(f = 20\ \mathrm{cm}\); \(1/s' = 1/20 - 1/30 = 1/60\), so \(s' = 60\ \mathrm{cm}\), real, \(m = -2\).

  6. Use matrices to find the focal length of two 200 mm lenses 100 mm apart.

    Show answer

    \(1/f = 2/200 - 100/40000 = 0.0075\), so \(f = 133\ \mathrm{mm}\).

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz