Thin Lens Calculator
Where does a lens put the image, how large is it, and is it real or virtual? From the focal length and the object distance the calculator solves the thin lens equation, draws the ray diagram, and handles a second lens for relays, microscopes and telescopes. Background: image plane, focal length, lens, and ABCD matrices.
Three short experiments. Each one sets the inputs, says where to look, and asks for a prediction before it shows the result.
These checks run in your browser on every load. The thin-lens equation is compared with cases worked out by hand and with Newton’s form, rays are traced through the lens to confirm that they cross at the computed image, and the two-lens formulas are checked against the ray-transfer matrix of the pair.
| Check | Expected | Computed | Tolerance |
|---|
The expected values follow the thin-lens and ray-matrix results in Hecht, Optics, and Pedrotti, Introduction to Optics, evaluated by hand for the stated cases. The tolerance is the largest difference from Expected that still passes, relative to Expected or to 1, whichever is larger.
A thin lens of focal length images an object at distance in front of it to an image at distance behind it, with lateral magnification :
in the real-is-positive convention: for a converging lens, for a real image behind the lens, and for a virtual image on the object side. A negative means the image is inverted. Measured from the focal points instead, the same relation is Newton’s form . For two lenses a distance apart, the image of the first becomes the object of the second at , the magnifications multiply, and the pair acts as one lens of effective focal length
The model is paraxial and treats each lens as having no thickness, so it gives the image position and size but not aberrations; a real lens of appreciable thickness is described by its principal planes, from which the same equations hold.
Worked example
A lens of 100 mm focal length with an object 150 mm in front of it forms a real, inverted image 300 mm behind it, magnified twice (m = −2). Moved to 50 mm, inside the focal length, the object gives a virtual, upright image 100 mm in front of the lens, also twice the size: the lens is then a magnifying glass. A 50 mm camera lens focused on a subject 1 m away puts the image plane 52.632 mm behind the lens, 2.632 mm further out than for a subject at infinity.
References: E. Hecht, Optics, 5th ed. (Pearson, 2017), ch. 5 and 6. F. L. Pedrotti, L. M. Pedrotti and L. S. Pedrotti, Introduction to Optics, 3rd ed. (Cambridge University Press, 2018), ch. 2 and 18.