› Lensmaker Equation Simulator Back
Optics Simulator

Lensmaker Equation Simulator — Thin Lens Imaging

Quick answer
A thin lens's focal length follows the lens-maker equation 1/f = (n − 1)(1/R₁ − 1/R₂) (n = refractive index, R₁ and R₂ = radii of curvature of the two surfaces). Object and image distances are linked by the Gaussian imaging formula 1/s + 1/s' = 1/f, and the transverse magnification is M = −s'/s (negative means inverted, |M| > 1 magnified).

For a thin lens in air, calculate focal length from refractive index and signed surface radii. Switch between parallel-input focusing and real or virtual images as object distance changes.

Parameters
Refractive index n
—
Radius R1 (front)
cm
Radius R2 (back)
cm
Object distance s
cm

All lengths are in cm. Light travels left to right. A surface radius is positive if its center of curvature is to the right, negative if to the left. Biconvex: R₁>0, R₂<0; biconcave: the reverse. Radius zero is invalid; use the Plane checkbox.

Animation only highlights rays; it does not represent the speed of light or travel time. Calculation remains available while stopped.

Results
—
Focal length f
—
Optical power P=1/f
—
Lens shape
—
Surface powers P₁ / P₂
—
Image distance s'
—
Magnification M=-s'/s
—
Image type
—
Converging / diverging
Curvature, focusing and thin-lens imaging

Incoming rays Outgoing rays Schematic profile (varies with R₁,R₂) Focal point F′ (signed distance f)

The profile and thickness are schematic. Rays bend at the central thin-lens plane: a paraxial model, not exact Snell-law tracing at the drawn surfaces. Horizontal and vertical scales differ, but object and image arrows share one vertical scale.

Magnifier example: n=1.5, R₁=10cm, R₂=−10cm give 1/f=0.1cm⁻¹. At s=5cm, s′=1/(0.1−0.2)=−10cm and M=2. The same lens at s=20cm gives s′=20cm and M=−1, a unit-size real image. Use the buttons to load these inputs.

Theory and key formulas

For a thin spherical lens in air, refractive index n and signed radii R1, R2 set the focal length (lensmaker equation):

$$\frac{1}{f} = (n-1)\left(\frac{1}{R_1} - \frac{1}{R_2}\right)$$

The Gaussian thin-lens equation links object distance s and image distance s':

$$\frac{1}{s} + \frac{1}{s'} = \frac{1}{f}$$

Transverse magnification M: negative is inverted, positive upright; |M|>1 magnified, |M|<1 reduced:

$$M = -\frac{s'}{s}$$

Assumptions: air (surrounding index 1), spherical thin lens, paraxial rays. A plane contributes 1/R=0. Power P=100/f in D when f is in cm. Thickness, aberrations, dispersion, compound lenses and underwater imaging are not computed. Each radius sign follows its center of curvature.

Reference: OpenStax University Physics Vol.3 §2.4: thin lenses, sign conventions and imaging. Diagrams and examples were created for this tool.

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?
🎓
For a thin spherical lens in air, $1/f=(n-1)(1/R_1-1/R_2)$ gives focal length from refractive index and signed surface radii. Starting at the defaults, changing R1 from 30 to 100cm increases f from 37.5 to about 66.7cm. Real photographic lenses also depend on thickness, element spacing and aberrations; this formula alone cannot explain price or image quality.
🙋
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.
🎓
For a converging lens with s>f, the Gaussian equation $1/s+1/s'=1/f$ makes s' approach f as the object moves away. With the default f=37.5cm and s=200cm, s'≈46.15cm. Parallel rays from a distant object meet at the image-side focus. For a diverging lens, their backward extensions meet at a virtual focus instead.
🙋
The magnification card reads -1.67. What does the negative sign mean?
🎓
Negative transverse magnification means an inverted image. In the imaging view its arrow points downward. The defaults give s'=100cm and M=−100/60≈−1.67, an inverted magnified real image. Optical image orientation and the orientation shown on a phone screen are different issues: image and display processing handle the latter, not a brain rotating the phone display.
🙋
So how do I reproduce a magnifying glass, where the image looks upright?
🎓
Choose the Magnifier example: n=1.5, R₁=10cm, R₂=−10cm give f=10cm. At s=5cm, s'=−10cm and M=2: an upright magnified virtual image. The dashed backward extensions meet on the object side; the outgoing rays themselves do not meet there. This transverse magnification is not the angular magnification perceived by an eye.

Frequently asked questions

Light travels left to right. A radius is positive if the surface center of curvature is to the right, negative if to the left. Biconvex: R₁>0, R₂<0; biconcave: the reverse. Enter lengths in cm. Radius zero is invalid: choose Plane, which contributes 1/R=0.
No. s′<0 denotes a virtual image on the object side. Backward extensions of the outgoing rays intersect there, not the actual rays. The Magnifier example has f=10cm and s=5cm, giving s′=−10cm and M=2. M here is transverse magnification, not the angular magnification seen by an eye.
At s=f the outgoing rays are parallel; there is no finite image distance or transverse magnification. At P=0 there is no additional focusing: the identity thin-lens limit for a finite object gives s′=−s and M=1. This does not imply a new projected image or focus.
No. The model is a spherical thin lens in air (surrounding index 1) with paraxial rays. n describes the lens, not the surrounding medium. Underwater imaging, thickness, spherical and chromatic aberrations, and multiple lenses are not computed. The drawn thickness is schematic, not a manufacturing specification.

Real-world applications

Understanding camera focus: Change object distance to see image distance move. For a converging lens, a sufficiently distant object forms an image near the focus. Real photographic lenses include element spacing, thickness and aberrations; this single-lens model does not predict zoom behavior or image quality.

Optical power and units: P=1/f uses focal length in m. For example, f=−50cm=−0.5m gives P=−2D. The tool converts cm to D explicitly. This is an optical quantity example, not an eyeglass or contact-lens prescription or fitting assessment.

Projection versus magnification: The Unit real image example has f=10cm, s=20cm, s′=20cm and M=−1. The Magnifier example has s=5cm, s′=−10cm and M=2. Compare a real image that can be projected on a screen with a virtual image located by backward extensions. Complete microscope or telescope magnification is outside this tool.

An introduction to laser optics: Compare the focus of parallel rays with parallel output when the object is at focus. These are geometric-optics constructions. Beam diameter, diffraction, Gaussian-beam spreading and fiber coupling efficiency are not computed.

Common pitfalls and caveats

Do not confuse thickness with curvature: This thin-lens equation neglects thickness and computes focal length from refractive index and surface curvatures. The drawn central thickness prevents crossing surfaces; it is not a calculation input. Changing default R₁ to 10cm gives f≈16.67cm, not a complete manufacturing specification.

Distinguish radius and distance signs: A radius is positive when its surface center of curvature is on the right, negative on the left. s is the positive distance from a real object on the left to the lens. s′ is positive for a real image on the right and negative for a virtual image on the left. Do not interpret every input as a signed rightward coordinate.

Scope: Spherical lens, air, thin-lens and paraxial approximations. Large-angle rays, thick-lens principal planes, spherical/chromatic aberrations and compound-system performance are not predicted. Near focus the image may lie outside the drawing range; read the status and numerical result together.

How to Use

  1. Set lens refractive index n between 1.30 and 2.50. The surrounding medium is fixed at index 1 (air).
  2. Enter R₁ and R₂ in cm. A curvature center on the right gives a positive radius, on the left a negative radius. Biconvex: R₁ positive, R₂ negative; biconcave: the reverse. Use Plane rather than radius zero.
  3. Set object distance s from 5 to 500cm. Focal length is f = 1 / {(n−1)[1/R₁ − 1/R₂]}, with zero curvature contribution for a plane surface.
  4. Use 1/s + 1/s' = 1/f and M=−s'/s for image distance and transverse magnification. Switch views or load a worked example to compare the drawing and results.

Worked Example

All lengths in this tool are cm. For n=1.52, R₁=50cm, R₂=−50cm and s=200cm: 1/f=0.52(1/50+1/50)=0.0208cm⁻¹, so f≈48.0769cm. Then s'=1/(0.0208−0.005)≈63.2911cm and M≈−0.31646: an inverted reduced real image. The Default button instead loads n=1.5, R₁=30cm, R₂=−50cm, s=60cm, giving f=37.5cm, s'=100cm and M=−5/3.

Practical Notes