Lens/Mirror Ray Tracer

Ray diagram for thin lenses and spherical mirrors. Compute image distance and magnification using the thin lens/mirror equation.

Inputs
cm
cm
Results
di = cm, m = , hi = cm
Image: • Orientation: • Scale:
Formula Breakdown
Thin Lens / Mirror Equation
  • 1/f = 1/do + 1/di solved for the unknown distance based on inputs.
  • Element selector applies the sign of f automatically (positive for converging/concave).
Magnification & Image Height
  • m = -di / do determines orientation (negative ⇒ inverted).
  • hi = m · ho produces the scaled image height used in the diagram.
Ray Diagram
FAQ & Teaching Notes
Concept Focus

Connect the algebraic thin lens equation with the visual ray diagram.

  • Ask students to predict di before pressing “Trace”.
  • Discuss why 1/f = 1/do + 1/di rearranges to solve for any variable.
Demo Tip

Slide the object inside the focal length to create a virtual image.

  • Challenge students to identify upright versus inverted arrows.
  • Relate the virtual image to everyday applications (make-up mirrors, magnifiers).
Misconception Alert

Sign errors are common; lean on the simulator’s automatic handling.

  • Switch between element types to see how ±f is assigned.
  • Note that a negative magnification indicates image inversion.
How do sign conventions work here?
The tool follows the standard Cartesian sign convention. For converging lenses and concave mirrors, focal length is positive; for diverging lenses and convex mirrors it is negative. Input fields accept positive distances, and the element selector adjusts signs under the hood.
Real vs. virtual image cues?
When do > f, the red image arrow appears on the right of the element, inverted—signalling a real image that could project onto a screen. When do < f, the image is drawn on the same side as the object and remains upright, showing a virtual image.
Link to magnification meaning
Magnification m = −di/do = hi/ho. Invite students to compare the numerical m with the drawn image height. If m = −1.5, expect an inverted image 1.5× taller than the object.

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.

About This Tool & Methodology

Visualizes geometric optics ray tracing for thin lenses and mirrors using standard sign conventions. Uses SI units and draws principal rays to show image formation.

Learning Outcomes

  • Interpret focal length, object distance, and image distance.
  • Understand upright/inverted and real/virtual images.
  • Practice sign conventions and units.

Authorship

  • Author: Anish Nath — Follow on X
  • Last updated: 2025-11-19

Trust & Privacy

  • Runs locally in your browser.