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.
How to use this calculator effectively
Pick the correct device first: lens or mirror, then choose whether it is converging/concave or diverging/convex. Enter focal length, object distance, and object height to see the image position, magnification, and ray diagram update together.
How it works
The calculator applies the thin lens or spherical mirror equation with the Gaussian sign convention. It then derives image distance, magnification, and image height from the same solved state so the numeric results and ray diagram stay consistent.
When to use
Use it for classroom demonstrations, homework checks, and quick optics intuition. It is especially useful when you want to compare how sign changes, object position, or focal length affect whether the image is real, virtual, upright, or inverted.
Common mistakes to avoid
- Choosing the wrong subtype sign before entering values.
- Mixing object distance and focal length units.
- Reading magnification magnitude without checking the sign.
- Treating a dashed virtual ray as a physical light path.
Interpretation and worked example
For a converging lens with the object outside the focal length, the image distance becomes positive and the image is real. Move the object inside the focal length and the result flips to a virtual upright image, which is a fast way to check whether your sign choices make physical sense.
See also
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.
What should I check first after I enter values?
Confirm the selected element type and the focal-length sign first, then check whether the ray diagram and the real/virtual label agree with the same scenario.
Why does this page differ from another tool?
Different pages often use different defaults, units, rounding rules, or assumptions. Align those settings before comparing outputs. If differences remain, compare each intermediate step rather than only the final number.
How reliable are the displayed values?
Values are computed in the browser and rounded for display. They are good for planning and educational checks, but for regulated or high-stakes decisions you should validate assumptions with official guidance or professional review.
Reading the result like an optics student
What this calculator shows
You get one solved state shared across the numeric summary, step log, and ray diagram. That makes it easier to connect the algebraic equation to the geometric picture instead of treating them as separate exercises.
Input meaning and sign policy
Keep all distances in the same unit. The subtype selector controls the sign of the focal length, while the solved image distance and magnification sign tell you whether the image is real or virtual, upright or inverted.
Suggested study sequence
Start with a converging lens or concave mirror, place the object outside the focal point, and confirm the real image case. Then move the object inside the focal length or switch to a diverging element to see how the classification changes.
Common mistakes to avoid
Do not compare ray diagrams from different sign conventions without checking the setup first. If the picture looks wrong, verify the selected subtype before assuming the formula failed.
Interpretation guidance
Use the image distance sign, the magnification sign, and the dashed-ray geometry together. When all three agree, the result is usually set up correctly and ready for note-taking or export.
How it’s calculated