Lens Formula Simulator
Use this interactive lens formula simulator to calculate image distance, magnification, and image height for convex and concave lenses using the thin lens equation.
Thin lens equation
1/f = 1/v + 1/u
The thin lens equation relates focal length f, object distance u, and image distance v. In this simulator, students enter object distance as a positive distance from the lens. Convex lenses use positive focal length, concave lenses use negative focal length, and the calculator solves v = 1 / (1/f - 1/u).
What is the lens formula?
The lens formula describes where an image forms when light from an object passes through a thin lens. It is a compact model for classroom optics problems, camera lenses, magnifying glasses, and basic ray diagrams.
This lens formula simulator turns the equation into an interactive optics simulator. Change the lens type, focal length, object distance, or object height, and the diagram updates so the calculated image position is easier to understand.
Convex lens vs concave lens
A convex lens has a positive focal length and can form a real inverted image when the object is beyond the focal point. If the object is inside the focal length, the image becomes virtual and upright.
A concave lens has a negative focal length. For a real object in this beginner-friendly convention, it generally forms a virtual, upright, diminished image on the same side as the object.
How to calculate image distance
Start with 1/f = 1/v + 1/u. Rearranging gives v = 1 / (1/f - 1/u). This page works as an image distance calculator by solving that expression whenever the inputs change.
If a convex lens has f = 10 cm and the object is u = 30 cm away, then v = 1 / (1/10 - 1/30) = 15 cm. The image forms on the opposite side of the lens.
What is magnification?
Magnification compares image height with object height. This simulator uses m = -v / u. A negative magnification means the image is inverted, while a positive magnification means the image is upright.
The tool also works as a magnification calculator because image height is calculated from image height = magnification × object height.
Real vs virtual image
A real image forms where light rays actually meet and can be projected onto a screen. In the diagram, real images appear on the opposite side of the lens from the object.
A virtual image forms where rays appear to come from. In the diagram, virtual images appear on the same side as the object and use a dashed arrow so the image type is not communicated by color alone.
Common mistakes
The most common mistake is mixing sign conventions. This simulator keeps object distance positive for beginner usability, then applies positive focal length for convex lenses and negative focal length for concave lenses.
Another common mistake is ignoring the focal point edge case. When the object distance equals the focal length for a convex lens, the image forms at infinity, so the page shows a friendly message instead of a broken number.
Practical examples
Convex lens beyond the focal point
With f = 10 cm and u = 30 cm, the image distance is 15 cm. The magnification is -0.5, so the image is real, inverted, and diminished.
Convex lens at the focal point
With f = 10 cm and u = 10 cm, the denominator becomes zero. The image forms at infinity instead of at a finite screen distance.
Concave lens
With f = -10 cm and u = 30 cm, the image distance is negative. The image is virtual, upright, and diminished.
FAQ
Is this a thin lens equation calculator?
Yes. It calculates image distance, magnification, and image height from the thin lens equation 1/f = 1/v + 1/u.
What sign convention does this lens equation calculator use?
Object distance is entered as positive for beginner usability. Convex focal length is positive, concave focal length is negative, and magnification is m = -v / u.
Why does the image go to infinity?
For a convex lens, an object at the focal point sends outgoing rays parallel to each other. The image distance is not finite, so the simulator reports that the image forms at infinity.
Can I use it as a convex lens simulator and concave lens simulator?
Yes. Use the lens type control to switch between convex and concave behavior, then compare how the image position and orientation change.