Lens Equation Calculator Formula

Understand the math behind the lens equation calculator. Each variable explained with a worked example.

Formulas Used

Image Distance

image_distance = 1 / (1/focal_length - 1/object_distance)

Magnification

magnification = -(1 / (1/focal_length - 1/object_distance)) / object_distance

Variables

VariableDescriptionDefault
focal_lengthFocal Length(cm)10
object_distanceObject Distance(cm)30

How It Works

Thin Lens Equation

The thin lens equation relates object distance, image distance, and focal length.

Formula

1/f = 1/d_o + 1/d_i

Positive focal length for converging lenses, negative for diverging. Magnification: M = -d_i / d_o. Negative M means inverted image.

Worked Example

An object 30 cm from a converging lens with focal length 10 cm.

focal_length = 10object_distance = 30
  1. 011/f = 1/do + 1/di
  2. 021/10 = 1/30 + 1/di
  3. 031/di = 1/10 - 1/30 = 3/30 - 1/30 = 2/30
  4. 04di = 15 cm
  5. 05M = -15/30 = -0.5 (inverted, half size)

Ready to run the numbers?

Open Lens Equation Calculator