Compute the focal length from refractive index and surface radii, then derive image distance and magnification. Three principal rays show how a thin lens forms an image.
Parameters
Refractive index n
—
Radius R1 (front)
cm
Radius R2 (back)
cm
Object distance s
cm
Sign convention: convex front R1>0, convex back R2<0. Defaults model a biconvex crown-glass lens (n=1.50).
Results
—
Focal length f
—
Image distance s'
—
Magnification M=-s'/s
—
Image type
Thin lens imaging and ray tracing
Blue = parallel ray (refracts through F') / green = chief ray through center (straight) / red = ray through F (refracts parallel to the axis)
Theory & Key Formulas
The thin-lens focal length is set by the refractive index n and the two surface radii R1, R2 (the lensmaker equation):
Object distance s and image distance s' are linked by the Gaussian thin-lens formula:
$$\frac{1}{s} + \frac{1}{s'} = \frac{1}{f}$$
Lateral magnification M. Negative means inverted, positive upright; |M|>1 enlarges, |M|<1 reduces:
$$M = -\frac{s'}{s}$$
Sign convention: distances measured from the lens; a convex front gives R1>0 and a convex back gives R2<0.
What is the lensmaker equation simulator?
🙋
How is a lens's focal length actually decided? What separates an expensive telephoto lens from a cheap one?
🎓
Roughly speaking, focal length is set entirely by the glass's refractive index and the two surface radii. That's the lensmaker equation $1/f=(n-1)(1/R_1-1/R_2)$. In the simulator above, push R1 from 30 up to 100 and watch the focal length stretch. A gentler curvature (larger radius) bends the rays less and gives a longer focal length.
🙋
Right. And when I slide the object distance s, the image distance s' card jumps around. At s=60 it shows s'=100; at s=200 it shrinks.
🎓
That is the Gaussian imaging formula $1/s+1/s'=1/f$ at work. As the object moves away, s' approaches f, and at s=∞ (a star at infinity) you get exactly s'=f. That's why we call it the focal length — for distant subjects the image sits right at the focal point.
🙋
The magnification card reads -1.67. What does the negative sign mean?
🎓
Negative magnification means the image is inverted. Notice the arrow on the right side of the canvas points downward. On a real camera sensor the image is also upside-down and flipped left-right; the brain (or the display chip) silently re-flips it for you. Since |M|>1 the image is also enlarged — that's exactly how a slide projector works.
🙋
So how do I reproduce a magnifying glass, where the image looks upright?
🎓
Set the object distance s smaller than the focal length f. Drop s to 5 in the simulator — s' goes negative and the image-type card reads "Upright, magnified virtual". The image only exists in extension behind the rays; that's what your eye sees through a hand magnifier. In the ray diagram you would trace the outgoing rays backward to find where they apparently cross.
Frequently asked questions
Spherical aberration appears because the paraxial assumption behind the lensmaker equation breaks down for marginal rays. Three remedies are common. First, stop down the aperture so peripheral rays are blocked — that is why photographic lenses sharpen as the f-number is raised. Second, use aspheric surfaces whose curvature varies smoothly toward the edge to focus all rays at one point. Third, cascade several lenses whose aberrations cancel; this is why premium camera lenses contain so many elements.
Because n depends on wavelength (dispersion), blue and red light have different focal lengths. The classical fix is the achromatic doublet: cement a low-dispersion crown convex element to a high-dispersion flint concave element so two chosen wavelengths (typically red and blue) share a focus. Apochromats bring three wavelengths together and are favored for astronomy and high-end photography. Modern digital workflows further apply per-channel software correction.
Two thin lenses in contact combine as $1/f = 1/f_1 + 1/f_2$. With a gap d between them you get $1/f = 1/f_1 + 1/f_2 - d/(f_1 f_2)$. Real camera lenses cascade six to fifteen elements to balance aberrations and deliver the desired focal length or zoom range. In professional design, system (ABCD) matrices represent refraction at each surface and propagation in between as matrix products, providing a compact framework.
A magnifier is one convex lens used with the object inside its focal length (s < f), forming an upright magnified virtual image. A telescope is two lenses: a long-focal objective forms an intermediate image of a distant object, and a short-focal eyepiece magnifies that intermediate image. Angular magnification is M = f_obj / f_eye, so long objectives and short eyepieces give high magnification — at the cost of narrower fields of view and dimmer images.
Real-world applications
Cameras and photography: Every camera lens, from the rear cam in a phone to a movie anamorphic, is designed around the lensmaker equation. Zoom lenses move internal groups to continuously vary their composite focal length, requiring dozens of elements designed with computer ray tracing.
Eyeglasses and contact lenses: Corrective lenses cancel the eye's refractive error. Myopia needs a concave (negative focal length) lens, hyperopia a convex (positive) one. The prescription in diopters is D = 1/f (m), so "-2.0 D" means a concave lens with f = −0.5 m. Contact lenses follow the same principle, with small corrections for the lens sitting on the cornea.
Microscopes and telescopes: Scientific imaging instruments concatenate thin-lens imaging equations. A biological microscope forms a magnified real image with the objective, then a virtual image with the eyepiece. Reflecting telescopes like Hubble swap lenses for curved mirrors, but the imaging mathematics is identical.
Laser optics and photonics: Laser-pointer collimation, coupling into optical fibers, semiconductor lithography, and laser welding all depend on precise thin-lens design. In optical communications, micron-level focus control is required, and the lensmaker equation is the starting point of every layout.
Common pitfalls and caveats
The most common misconception is that a thicker lens automatically means a shorter focal length. What actually matters is the surface curvature, not the geometric thickness. Lens thickness enters only in the "thick-lens" treatment; the thin-lens model ignores it entirely. Try R1=10 in the simulator — f collapses immediately because tight curvature bends rays strongly. The curvature, not the bulk, drives focal length.
Second, sign-convention errors trip up almost everyone. This tool uses the Cartesian convention: positive distances run from the lens to the right. A convex front surface has R1>0 and a convex back surface has R2<0, so a biconvex lens (R1>0, R2<0) gives positive f (converging). A biconcave lens (R1<0, R2>0) gives negative f (diverging). Flip the signs of R1 and R2 in the simulator and watch f swap sign accordingly.
Finally, remember that this is a paraxial, thin-lens model, not a complete lens-performance predictor. Real lenses have non-negligible thickness and marginal rays violate the paraxial approximation, producing spherical aberration. Dispersion adds chromatic aberration. Professional design uses the lensmaker estimate as a starting point and then traces every ray in Zemax or CODE V to minimize all aberrations simultaneously. Even so, the lensmaker equation remains the indispensable foundation for first-cut design and physical intuition.