Lens Simulator

Drag the green object arrow left and right to explore image formation for converging and diverging lenses. Compare a manual focal length with the focal length predicted by the lens maker equation.

How the Lens Maker Formula Is Used

1/f = ((n₂ - n₁) / n₁) × (1/R₁ - 1/R₂)

This simulator can calculate the focal length in two different ways. In Manual slider mode, you choose f directly. In Lens maker equation mode, the simulator computes f from the refractive index and the two surface radii.

  • n₁ is the refractive index of the surrounding medium, which is set to air in this demo.
  • n₂ is the refractive index of the lens material, controlled by the slider.
  • R₁ and R₂ describe the curvature of the front and back lens surfaces.
  • A more strongly curved lens or a bigger difference between n₂ and n₁ gives a stronger lens power, which changes the focal length.

After the simulator finds f, it uses the thin-lens equation below to determine where the image forms:

1/f = 1/dₒ + 1/dᵢ

Here dₒ is the object distance and dᵢ is the image distance. Then the magnification is found from m = -dᵢ / dₒ, which tells whether the image is upright or inverted and how tall it should be.

Lens Controls

Readout

For a converging lens, a real image appears on the right side when the object is outside the focal length. For a diverging lens, the image stays virtual and upright on the same side as the object.