Thin Lens Ray Tracer

Adjust focal length and object distance to see how a thin lens forms real or virtual images.

Loading interactive simulation...

Object and image can trade places 🖖

The thin-lens equation 1/v = 1/f βˆ’ 1/u is symmetric in u and v, and this tool will show it. Load the converging preset β€” f = 100 mm, object at 250 mm β€” and the image distance reads 166.7 mm at βˆ’0.67Γ—. Now type 166.7 into the object-distance field: the image goes to 250 mm at βˆ’1.50Γ—. The two magnifications multiply to exactly 1. Every lens therefore has two object positions that focus onto the same screen, one enlarging and one reducing, and the distance between them yields f without ever having to locate the lens's centre β€” the classical Bessel displacement method.

Two rays are all you need 🖖

A thin lens bends every ray leaving a point on the object so they reconverge at one image point, so you only have to track two easy ones. The parallel ray leaves the tip horizontally and exits through the focal point; the centre ray passes straight through the middle of the lens, undeviated. Wherever those two cross is the image. If they only meet when traced backwards, the image is virtual β€” that is the magnifying-glass case.

The image that flies through infinity 🖖

Move the object toward the focal point and watch the image distance v race off to +∞, vanish, then reappear far on the left as βˆ’βˆž β€” a virtual image. Nothing physically teleports; the lens equation 1/v = 1/f βˆ’ 1/u is a MΓΆbius (fractional-linear) map, and such maps treat infinity as an ordinary point. Crossing u = f simply passes the image smoothly through that point at infinity, flipping it from real to virtual.

Problem solved in full

  1. A 40 mm object 250 mm in front of a converging lens 5 steps

    A 40 mm object stands 250 mm in front of a converging lens of focal length 100 mm. Find the image β€” where, how big, which way up β€” and then find the one thing this lens cannot do.

    1. One equation governs the whole page. Rearrange it for the image distance before putting any numbers in, so the arithmetic happens once.

    2. Substitute. Both reciprocals share a denominator of 250, which is the entire calculation; the tool prints this figure.

    3. Magnification is the ratio of the two distances, negative because a real image is inverted. The object is beyond 2f, so the image had to come out smaller β€” that is the projector run backwards.

    4. Newton's form of the same law measures both distances from the focal points instead of the lens. Their product is fΒ² exactly, for every object position, which is a stronger statement than the reciprocal form looks capable of making.

    5. Now ask how close object and image can ever be. Minimising their separation gives a symmetric arrangement, and the answer depends on nothing but the lens.

    Answer

    The image forms 166.7 mm behind the lens, inverted, 26.7 mm tall. The last line is the useful one. Object and image are 416.7 mm apart here, and no setting of the object distance ever brings them closer than 4f = 400 mm: as you push the object toward the focus the image runs away faster than the object approaches. A projector that has to throw a real image onto a screen therefore has a hard minimum throw, set by its focal length alone β€” which is why a short room needs a short lens, not a cleverer one.

Learning path

Bending light

Leads to Real lenses the thin-lens equation as a drawing rather than a formula.

References (2)
  • The thin-lens conjugate relation and the two-position focal-length method: Eugene Hecht, Optics, 5th edition, ch. 5. Pearson, 2017. ISBN 978-0-13-397722-6.
  • Gaussian optics and conjugate planes, in full: M. Born and E. Wolf, Principles of Optics, 7th (expanded) edition, ch. 4. Cambridge University Press, 1999. ISBN 978-0-521-64222-4.

Example problems