Optics1/f = 1/d_o + 1/d_i

Thin Lens Simulator

Explore image formation by converging and diverging lenses. Adjust object distance and focal length to see real and virtual images via ray diagrams.

Parameters
Object distance d_o
cm
Focal length f
cm

Computed
Image distance d_i80.0 cm
Magnification m-1.00
Image typeReal
OrientationInverted
Relative sizeSame size
d_o80 cm
f40 cm
d_i80.0 cm
m-1.00
TypeReal
Orient.Inverted

How the Thin Lens Simulator Works

A thin lens bends parallel light rays so they converge to (or diverge from) a focal point. The simulator draws three principal rays from the tip of the object to locate the image, and applies the thin lens equation to calculate exact image properties.

Converging lenses (positive f) can form real inverted images or virtual upright images depending on object distance. Diverging lenses (negative f) always form virtual, upright, diminished images.

Key Variables

SymbolNameSign Convention
d_oObject distanceAlways positive (object on left of lens)
d_iImage distancePositive = real image (right of lens); Negative = virtual (left of lens)
fFocal lengthPositive = converging; Negative = diverging
mMagnificationNegative = inverted; |m| > 1 = enlarged
PLens powerP = 1/f in diopters (f in metres)

Three Principal Rays

  • Ray parallel to the axis refracts through the far focal point F′ (converging) or appears to diverge from F′ (diverging).
  • Ray through the optical centre passes straight through without bending.
  • Ray through the near focal point F refracts parallel to the axis (converging) or aimed at F (diverging).

Image Types

ConditionImage TypeOrientationRelative Size
d_o > 2f (converging)RealInvertedDiminished
d_o = 2f (converging)RealInvertedSame size
f < d_o < 2f (converging)RealInvertedEnlarged
d_o < f (converging)VirtualUprightEnlarged
Any d_o (diverging)VirtualUprightDiminished

Thin Lens Equation

Rearranged to find image distance:

Magnification

Lens Power

💡When two thin lenses are in contact, their powers add: P_total = P₁ + P₂.

Frequently Asked Questions

What is the sign convention for the thin lens equation?

Object distance d_o is always positive (real object). Image distance d_i is positive for a real image on the far side of the lens and negative for a virtual image on the same side as the object. Focal length f is positive for converging lenses and negative for diverging lenses.

What happens when the object is at the focal point?

When d_o = f, the image forms at infinity — the refracted rays emerge parallel and never converge. This is used in collimators and spotlights to produce a parallel beam.

Why can't a diverging lens form a real image?

A diverging lens always spreads rays apart. The extensions of those diverging rays appear to come from a point on the same side as the object, producing a virtual, upright, diminished image regardless of object position.

How is lens power related to focal length?

Power P = 1/f where f is in metres. A +2 dioptre lens has f = 0.5 m (converging). A −3 dioptre lens has f = −0.33 m (diverging). Eyeglass prescriptions are given in dioptres.