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)

Frequently Asked Questions

What does a negative image distance mean?

A negative image distance means the image is on the same side as the object (virtual image). This happens when the object is inside the focal length.

What is a virtual image?

An image that cannot be projected onto a screen. Light rays appear to diverge from the image location but do not actually pass through it.

How does a magnifying glass work?

By placing an object inside the focal length of a converging lens, creating an enlarged virtual image.

Learn More

Guide

Understanding Optics and Lenses

A complete guide to optics and lenses. Learn about refraction, Snell's law, converging and diverging lenses, the thin lens equation, magnification, mirrors, and optical instruments.

Ready to run the numbers?

Open Lens Equation Calculator