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.

Problems 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.

  2. The magnifying glass, and why the handle says 5Γ— 7 steps

    Hold a 50 mm lens 30 mm above a 40 mm beetle. Where is the image, which way up, and how big? Then explain why the tool prints 2.50Γ— for a glass whose handle is stamped 5Γ—.

    Open this problem in the tool

    1. Nothing changes in the method: the same equation as problem 1, on a shorter lens. What changes is that the object now sits inside the focal length instead of well outside it.

    2. The image distance comes out negative, and that is the whole answer to "where". Negative means the rays leave the lens still spreading apart, so they never meet and no screen will catch anything. Traced backwards they appear to come from a point 75 mm away on the same side as the beetle, which is where your eye finds the image.

    3. Magnification carries the sign with it. Positive m means upright, so the beetle is the right way up at 100 mm tall, and the tool labels the image virtual and upright.

    4. Solve the equation in general rather than at one setting, and the behaviour of every magnifier falls out of one fraction. Inside the focal length of a converging lens the magnification is greater than one and positive, at every distance, with no exceptions to remember.

    5. The two ends are worth checking against your hands. Push the lens down onto the beetle and the magnification goes to 1, which is what a lens lying flat on a page does. Raise it towards the focal point and the magnification runs away, though the image races off to infinity at the same time and your eye loses it. That is why the "Object at focal point" preset prints ∞ rather than a number.

    6. So where does 5Γ— come from? Not from this calculation. What a magnifier sells is angular size, not linear size: how wide the beetle looks compared with holding it at the closest distance a relaxed eye can focus, conventionally 250 mm. Put the object at the focal point, let the rays emerge parallel, and the comparison is a ratio of two angles.

    7. Pull the image in to that 250 mm near point instead and the same lens earns 6Γ—. Both conventions are in use, which is why a 5Γ— loupe from one maker and a 6Γ— from another can be the same piece of glass. The tool reports linear magnification at the distance you actually chose, which is the number a ruler laid across the image would get. What your eye gets depends on where you hold it: bring the image out to the near point and the two agree.

    Answer

    75 mm from the lens, on the same side as the beetle, upright, 100 mm tall, and virtual. The 2.50Γ— the page prints and the 5Γ— on the handle measure different things: one is the ratio of image height to object height at the position you are holding the lens, the other a ratio of apparent angles at a fixed viewing convention.

Learning path

Bending light

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.