Playground

Interactive thin lens ray diagram: move the object distance slider to see the image form, flip from real to virtual, and display magnification.

Variables

SymbolNameSIDimensionRange
ffFocal length
Distance from lens center to focal point (positive for converging, negative for diverging)
mL-0.5 – 0.5
dod_oObject distance
Distance from object to the lens center
mL0.01 – 2
did_iImage distanceoutput
Distance from lens center to the image (positive for real, negative for virtual)
mL-2 – 2

Deep dive

Derivation
Using similar triangles from ray diagrams: a ray through the center is undeviated, and a ray parallel to the axis refracts through the focal point. For a thin lens, equating the two triangles gives h_i/h_o = d_i/d_o (magnification) and h_i/h_o = (d_i - f)/f. Setting these equal: d_i/d_o = (d_i - f)/f → f·d_i = d_o·d_i - d_o·f → d_o·f + d_i·f = d_o·d_i. Dividing by d_o·d_i·f: 1/f = 1/d_o + 1/d_i.
Experimental verification
Verified by measuring object and image distances with calibrated optical benches. Modern automated lens testing systems confirm focal lengths to < 0.1% accuracy using collimated laser sources.
Common misconceptions
  • Covering half the lens removes half the image — it dims the whole image, doesn't cut it in half.
  • A negative image distance means no image — it means a virtual image on the same side as the object.
  • The formula works for thick lenses — it only works when lens thickness << focal length (thin lens approximation).
Real-world applications
  • Camera autofocus: adjusts d_o by moving the lens to satisfy 1/f = 1/d_o + 1/d_i.
  • Eyeglasses: diverging lenses (f < 0) correct myopia by shifting the image back to the retina.
  • Projectors: place the slide at d_o slightly > f to get a large real image on a distant screen.
  • Magnifying glasses: object inside f produces a virtual, magnified, upright image.

Worked examples

Converging lens image

Given:
f:
0.1
d_o:
0.15
Find: d_i
Solution

d_i = f*d_o/(d_o - f) = 0.10 × 0.15 / (0.15 - 0.10) = 0.015/0.05 = 0.30 m

Diverging lens virtual image

Given:
f:
-0.2
d_o:
0.3
Find: d_i
Solution

d_i = f*d_o/(d_o - f) = (-0.20)(0.30)/(0.30 - (-0.20)) = -0.06/0.50 = -0.12 m

Scenarios

What if…
  • scenario:
    What if d_o = f exactly?
    answer:
    1/d_i = 0, so d_i → ∞. Rays emerge parallel — the image forms at infinity. This is how collimated beams are made.
  • scenario:
    What if d_o < f for a converging lens?
    answer:
    d_i becomes negative — a virtual, upright, magnified image forms. This is the magnifying glass regime.
  • scenario:
    What if the lens is in water instead of air?
    answer:
    The focal length changes because refraction depends on the ratio of lens-to-medium refractive indices. The lensmaker's equation must be used with the medium's n.
Limiting cases
  • condition:
    d_o → ∞
    result:
    d_i → f
    explanation:
    Parallel rays (distant object) converge at the focal point.
  • condition:
    d_o = f
    result:
    d_i → ∞
    explanation:
    Object at focal point produces parallel rays — image at infinity.
  • condition:
    d_o = 2f
    result:
    d_i = 2f
    explanation:
    Object at 2f produces a same-size inverted image at 2f.

Context

Multiple contributors · 1693

Developed through contributions by Kepler, Barrow, and Halley. The modern thin lens formula was formalized in the late 17th century.

Hook

How far must you hold a magnifying glass from a bug to project its image on a wall?

A thin converging lens (f = 10 cm) views an object at 15 cm. Find the image distance using 1/f = 1/do + 1/di.

Dimensions:
lhs:
1/f → [L⁻¹]
rhs:
1/d_o + 1/d_i → [L⁻¹] + [L⁻¹] = [L⁻¹]
check:
Both sides are [L⁻¹] = diopters (m⁻¹). ✓
Validity: Valid for thin lenses (thickness << focal length) in the paraxial approximation (small angles). Breaks down for thick lenses and wide-angle rays (aberrations).

Related formulas