Lens & Mirror Equation — with steps and ray diagram

Solve the thin lens and spherical mirror equation in classroom-ready form: compute image distance dᵢ, magnification, and image height while the ray diagram updates in sync with every change.

Designed for physics instruction, the workspace stores your units in the shareable URL, records the full How it's calculated log, and offers CSV exports for lab reports or LMS uploads.

Other languages: ja | en | es | zh-CN
Inputs
Advanced: Lensmaker & mirror radius helpers

Provide n, R₁, and R₂ to compute the lensmaker focal length f = 1 / ((n−1)(1/R₁ − 1/R₂)). For mirrors, the helper reports f = R/2.

Keyboard shortcuts: Ctrl+Enter runs the calculation, Ctrl+S exports the CSV, Ctrl+L copies the share URL.

Result summary

How it's calculated

    Ray diagram

    The canvas plots the optical axis, focal points, object arrow, image arrow, and the three principal rays. Virtual rays are dashed for easy differentiation.

    FAQ

    How do I know if the image is real or virtual?

    The sign convention follows the Gaussian Cartesian rule: dᵢ > 0 indicates a real image on the outgoing side, whereas dᵢ < 0 marks a virtual image on the object side. The magnification sign shows whether the image is upright (m > 0) or inverted (m < 0).

    What ray diagram does the tool draw?

    We plot the parallel ray through the focus, the ray that heads toward the focus and exits parallel, and the central ray. Dashed segments denote virtual extensions so diverging lenses and convex mirrors remain easy to follow.