Thin Lens Ray Diagram Calculator
Interactive ray diagram for converging and diverging lenses. Drag the object to see how the image changes in real time.
There's a converging lens with a focal length of 10 cm. You place an object 25 cm away. Where does the image form, is it real or virtual, and is it upright or inverted? You can solve this with the thin lens equation (1/f = 1/do + 1/di), or you can draw a ray diagram. The lens calculator does both at once.
Interactive ray tracing
Select converging or diverging, set the focal length, and position the object. The tool draws three principal rays: one parallel to the axis that refracts through the focal point, one through the center that goes straight, and one through the near focal point that exits parallel. Where these rays converge is where the image forms.
The numbers appear alongside: image distance, magnification, and whether the image is real/virtual and upright/inverted. For the example above (f = 10 cm, do = 25 cm), you get di ≈ 16.7 cm, M ≈ −0.67, real and inverted. The negative magnification confirms the inversion.
Drag it around
The real learning happens when you move the object. Drag it from far away toward the lens and watch the image move. When the object is beyond 2f, the image is small and close to f. As the object approaches 2f, the image approaches 2f on the other side and reaches the same size. Move inside 2f and the image grows and moves farther away. Put the object exactly at f and the image distance goes to infinity — the rays exit parallel.
Move inside f and something interesting happens: the rays diverge on the exit side, so there's no real image. But extend the rays backward and they converge on the same side as the object — a virtual, upright, magnified image. That's how a magnifying glass works.
Switch to a diverging lens and the behavior changes entirely. The image is always virtual, upright, and smaller, regardless of object position. The lens calculator makes all of these cases explorable in seconds.
For motion problems that don't involve optics, the kinematics calculator covers constant-acceleration scenarios.