Optical Bench (Lens Ray Tracer)

Trace rays through a system of thin lenses; drag the object and lenses, set focal lengths, and see real/virtual image formation and magnification.

About this tool

Optical bench ray tracer for systems of thin lenses on a common axis. Drag the green object arrow and the blue lenses; set each focal length (positive = converging, negative = diverging). A fan of rays from the object tip is traced through every lens to show where the image forms.

How to use

  • Drag the object or any lens left/right along the axis.
  • Set object height and each lens's focal length (cm).
  • Add lens for compound systems (telescope, microscope, relay).
  • Focal points F are marked on the axis either side of each lens.

Reading the result: a solid arrow is a real image (rays actually cross, right of the last lens); a dashed arrow is a virtual image (rays only appear to diverge from it). The readout gives image distance, magnification, and whether the image is upright or inverted.

Physics: each lens obeys 1/v = 1/f + 1/u with magnification m = v/u; the image of one lens is the object for the next, and the total magnification is the product. Ray rule at a lens: slope′ = slope − h/f for a ray at height h above the axis.

Limitations: ideal thin lenses, paraxial focal lengths, no aberrations, no aperture clipping or mirrors.