This simulator traces the principal rays through a thin convex (converging) or concave (diverging) lens as you move the object and change the focal length, solving the thin-lens equation live to show exactly where the image forms, how large it is, and whether it is real or virtual.
• A full ray-tracing diagram with the object arrow, the lens, both focal points (F) and their doubles (2F), and up to three principal rays traced to the resulting image. • Four live controls: lens type (converging/diverging), focal length magnitude, object distance, and object height. • Live readouts for object distance, image distance, magnification, and image type (real/virtual, upright/inverted). • Four preset scenarios: object beyond 2F, between F and 2F, inside F (magnifying-glass mode), and a diverging lens for comparison.
1/f = 1/dₒ + 1/dᵢ relates focal length, object distance and image distance for any thin lens. Solving for image distance, dᵢ = 1/(1/f − 1/dₒ), and magnification follows as m = −dᵢ/dₒ: negative magnification means an inverted image, and |m| greater than 1 means an enlarged one. The simulator solves this equation live every time you move a slider.
A converging (convex) lens produces a real, inverted image when the object sits beyond the focal point, and a magnified, upright virtual image when the object is inside the focal point — the basis of a magnifying glass. A diverging (concave) lens, by contrast, always produces a smaller, upright, virtual image no matter where the object is placed, which is why diverging lenses (used to correct nearsightedness) never form real images on their own.
1/f = 1/dₒ + 1/dᵢ, where f is focal length, dₒ is object distance and dᵢ is image distance. Solving for dᵢ tells you exactly where the image forms for any object position.
When the object is farther from the lens than the focal length, the image is real and inverted. When the object is closer than the focal length, the refracted rays diverge and never actually meet — tracing them backward gives a magnified, upright virtual image instead.
No. A single diverging (concave) lens always produces a smaller, upright, virtual image regardless of object distance — it can only form a real image as part of a multi-lens system.
A negative magnification value (m = −dᵢ/dₒ) means the image is inverted relative to the object. The magnitude of m tells you whether the image is enlarged (|m| > 1) or reduced (|m| < 1).