Thin Lens Calculator Back
Optics Simulator

Thin Lens Calculator — Ray Diagram, Image Distance & Magnification

Adjust focal length and object distance to instantly see 3 principal rays move and compute image distance, magnification, and real/virtual image classification for converging and diverging lenses.

Parameters
Focal length f (mm) 150
-500 (diverging)0+500 (converging)
Object distance do (mm) 300
101000
Image dist. di (mm)
Magnification m (×)
Image type / orientation

Thin Lens Equation

$$\frac{1}{f}= \frac{1}{d_o}+ \frac{1}{d_i}$$

$$m = -\frac{d_i}{d_o}$$

$d_i > 0$: real image (projectable)
$d_i < 0$: virtual image (non-projectable)
$m < 0$: inverted   $m > 0$: upright

Ray Diagram
Image distance di vs object distance do

What is a Thin Lens?

🧑‍🎓
What exactly is the "thin lens equation" that this simulator is based on? It seems like magic that you can predict where an image will form.
🎓
It's not magic, it's geometry! Basically, the equation is a simple relationship between three distances: the focal length of the lens ($f$), how far the object is ($d_o$), and where the image appears ($d_i$). In practice, if you know any two, you can solve for the third. Try moving the "Focal Length" slider in the simulator—you'll instantly see the image distance change.
🧑‍🎓
Wait, really? So if I put the object really close to the lens, the image goes far away? And what does a negative image distance mean?
🎓
Exactly! That's a key insight. For a converging lens (positive $f$), if you move the object inside the focal point ($d_o < f$), the simulator will show a negative $d_i$. That's the math telling you the image is virtual—it appears on the same side of the lens as the object and can't be projected onto a screen. A common case is a magnifying glass. Try setting the object distance to be less than the focal length and watch the rays diverge.
🧑‍🎓
Okay, I see the image distance and the ray diagram. But what about the magnification number? Why is it sometimes negative?
🎓
Great question! The magnification $m$ tells you two things. Its absolute value is the size ratio (image height / object height). The sign tells you the orientation. A positive $m$ means the image is upright relative to the object. A negative $m$ means it's inverted. For instance, in a projector (real image), $m$ is negative and large. In the simulator, when you get a real image ($d_i > 0$), you'll always see a negative magnification for a single lens, meaning the image is upside-down.

Physical Model & Key Equations

The fundamental relationship governing image formation by a thin lens is derived from the geometry of light rays. It connects the focal length of the lens to the positions of the object and the image.

$$\frac{1}{f}= \frac{1}{d_o}+ \frac{1}{d_i}$$

$f$: Focal length of the lens. Positive for converging (convex) lenses, negative for diverging (concave) lenses.
$d_o$: Object distance (always taken as positive for real objects).
$d_i$: Image distance. Positive values indicate a real image formed on the opposite side of the lens from the object. Negative values indicate a virtual image formed on the same side as the object.

The lateral magnification describes how much larger or smaller the image is compared to the object, and whether it is inverted.

$$m = -\frac{d_i}{d_o}$$

$m$: Lateral magnification. If $|m| > 1$, the image is magnified; if $|m| < 1$, it is diminished. The sign of $m$ indicates orientation: $m < 0$ means the image is inverted relative to the object; $m > 0$ means it is upright.

Real-World Applications

Digital Camera & Smartphone Lenses: The lens focuses light from a distant object onto the camera sensor (a real image). Autofocus systems physically move lens elements to adjust the effective focal length or image distance ($d_i$) to satisfy the thin lens equation for sharp focus on the sensor plane.

Magnifying Glass (Simple Microscope): When you hold a magnifying glass close to an object (with $d_o < f$), the lens produces a virtual, upright, and magnified image ($m > 0$). This is why text appears larger when viewed through the lens.

Eyeglasses & Contact Lenses: These are thin lenses designed to correct vision. For a nearsighted person, a diverging lens (negative $f$) is used to take a distant object and create a virtual image at the person's far point, which their eye can then focus on clearly.

Projectors and Overhead Projectors: These devices use a converging lens to take a small slide or LCD image (the object) and project a large, real, and inverted image ($m$ is negative and large in magnitude) onto a distant screen. The setup requires $d_o$ to be slightly greater than $f$.

Common Misconceptions and Points to Note

First, don't be misled by the term "thin lens." This is an idealized model that assumes "the lens thickness is negligible compared to the focal length." You cannot design real lenses, especially the complex lens assemblies in smartphone cameras, based on this calculation alone. Use it strictly as a "first approximation" concept.

Next, pay attention to the behavior when you set the object distance $d_o$ to a value just slightly larger than the focal length $f$. For example, with an $f=50mm$ lens and $d_o=55mm$, the formula gives a very large $d_i$ of $550mm$. In this state, the magnification is high (approximately -10x) and the image forms far away, so even a tiny error in $d_o$ (e.g., 1mm) can cause $d_i$ to fluctuate by tens of millimeters, resulting in a significant focus shift. This is precisely why focus becomes so critical in high-magnification macro photography in practical applications.

Also, while it's common to memorize that "a concave lens always forms a virtual image," there are cases where a concave lens can form a real image if you treat the object as a "virtual object" (i.e., converging light rays coming from another lens). This is an advanced concept important for designing optical systems with multiple combined lenses. While it's fine to think "always a virtual image" when working with a single concave lens in NovaSolver, it's good to keep this nuance in the back of your mind.

Related Engineering Fields

This thin lens calculation actually has applications far beyond just "optics." For instance, in acoustical engineering, the same formula is applied in designing ultrasonic lenses used for focusing sound waves. You'll find these used inside the transducers of medical ultrasound diagnostic equipment, for example.

Photolithography, a core technology in semiconductor manufacturing, is the ultimate application of lens systems. Huge, complex projection lenses are used to reduce and project circuit patterns. Here, the goal is to reduce aberrations (deviations from the ideal) to nearly zero, and the thin lens formula serves as the starting point.

Furthermore, in fields like electromagnetic wave engineering and antenna design, the design principles for focusing radio waves, such as in parabolic antennas and lens antennas, are very similar to geometric optics. Although it uses radio waves instead of light, the principle of placing a feed at the "focal point" to radiate a plane wave is essentially the same concept as a lens.

For Further Learning

Once you're comfortable with thin lenses, the next recommended step is to learn the "lensmaker's equation." This formula calculates the focal length $f$ of a lens from its radii of curvature, thickness, and the refractive index of the material, expressed as $$ \frac{1}{f} = (n-1)\left( \frac{1}{R_1} - \frac{1}{R_2} + \frac{(n-1)d}{n R_1 R_2} \right)$$. Understanding this will help you grasp why lenses have convex or concave shapes and how the material affects their properties.

The next challenge is understanding "aberrations." The thin lens formula only considers ideal "paraxial rays." In real lenses, aberrations occur, such as shifts in focal position due to color (chromatic aberration) or image distortion (distortion). High-performance camera lenses combine multiple lens elements precisely to cancel out these aberrations. A good way to visualize this is to think of the scattering of rays that appears in simulation tools when you push parameters to extremes as the seeds of aberration.