Lessons · optics

Image formation by a thin lens: why the ray diagram is the lens equation

Regime 3 — an algebra-only domain, and here the honest second register is geometry, not calculus: the ray diagram. The same image distance falls out of similar triangles, and SymPy proves the three principal-ray constructions agree — which IS the thin-lens equation.

Regime 3 · algebra-only Math machine-derived & checked by SymPy 3 modeling assumptions (author-asserted)

A converging lens with focal length f=1f = 1 m. An object ho=0.4h_o = 0.4 m tall stands a distance dod_o to the left. Slide the object along the axis: outside the focal point it makes a real, inverted image you could catch on a screen (a projector); slide it inside the focal point and the image flips to virtual, upright, and enlarged (a magnifying glass). The thin-lens equation 1/do+1/di=1/f1/d_o + 1/d_i = 1/f tells you where the image is — but the ray diagram shows you why, with three straight lines and no equation at all.

Image distance di=dof/(dof)d_i = d_o f/(d_o-f) at do=1.5d_o = 1.5 m
3 m
Magnification m=di/dom = -d_i/d_o at do=1.5d_o = 1.5 m (a pure number)
-2
Image height hi=mhoh_i = m\,h_o at do=1.5d_o = 1.5 m, ho=0.4h_o = 0.4 m
-0.8 m
Draw three rays from the tip of the object — no equation needed
(1) parallelF(2) through centerstraight(3) Fparallel\text{(1) parallel}\leftrightarrow F' \qquad \text{(2) through center}\to\text{straight} \qquad \text{(3) } F \leftrightarrow \text{parallel}

Geometric optics needs no calculus and, at first, no algebra. From the object tip, the ray parallel to the axis bends through the far focus FF'; the ray through the lens center goes straight; the ray through the near focus FF leaves parallel. Each is a straight line you can rule by hand. Where they cross is the image.

check di=dof/(dof)d_i = d_o f/(d_o-f) solves 1/do+1/di=1/f1/d_o+1/d_i=1/f; chief ray m=di/dom=-d_i/d_o; parallel & focal rays give the same mm; m=f/(fdo)m = f/(f-d_o)

  • The closed form di=dofdofd_i = \dfrac{d_o f}{d_o - f} satisfies the thin-lens equation 1do+1di=1f\dfrac{1}{d_o} + \dfrac{1}{d_i} = \dfrac{1}{f} — back-substituting leaves zero. [structural]
  • The ray through the lens center is undeviated, so the object and image triangles about the center are similar: m=hi/ho=di/dom = h_i/h_o = -d_i/d_o. [structural]
  • The parallel ray refracts toward (or away from) the focus, giving m=(dif)/fm = -(d_i - f)/f by similar triangles. It equals the chief-ray value di/do-d_i/d_o — the two independent constructions locate the same image point, and that agreement is exactly the thin-lens equation. [structural]
  • The focal ray (through a focus, emerging parallel) gives m=f/(dof)m = -f/(d_o - f) — the same magnification again. All three principal-ray constructions locate one image point. [structural]
  • The magnification in terms of do,fd_o, f alone: m=dido=ffdom = -\dfrac{d_i}{d_o} = \dfrac{f}{f - d_o} — its sign sets the orientation (upright when m>0m>0, inverted when m<0m<0), its size the scale. [structural]

Dimensional homogeneity: checked by SymPy (holds).

Common misconception: “A taller object is magnified more — the magnification depends on the object's size.

It does not. The magnification m=di/dom = -d_i/d_o is fixed by the two distances alone — a property of the lens and where you place the object, not of the object's height. Drag the object-height slider: the image grows and shrinks in step with the object, but mm (and whether the image is enlarged or reduced) never changes. Magnification is about the geometry of the rays, which is why the same lens magnifies a tall tree and a short flower by the same factor at the same distance.

Modeling assumptions — author-asserted, disclosed not discharged
  • A thin lens: its thickness is negligible next to the focal length, so both refractions happen in one plane at the lens center.
  • Paraxial rays — all rays stay close to the axis, so a point object maps to a single point image. Real lenses with wide apertures blur this (spherical aberration).
  • A single converging lens, f>0f > 0, with the sign convention that a real image (on the far side, catchable on a screen) has di>0d_i > 0 and a virtual image has di<0d_i < 0.

The ray diagram, fully annotated

A static rendering (Matplotlib) at the default object distance — the three principal rays converging to the real, inverted image. The interactive version, with object-distance and height sliders, is in the Graph tab above.

2026-06-27T10:02:48.439250 image/svg+xml Matplotlib v3.11.0, https://matplotlib.org/