$$\frac{1}{f}= \frac{1}{d_o}+ \frac{1}{d_i}$$
$$m = -\frac{d_i}{d_o}$$
$d_i \gt 0$: real image (projectable)
$d_i \lt 0$: virtual image (non-projectable)
$m \lt 0$: inverted $m \gt 0$: upright
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.
$$\frac{1}{f}= \frac{1}{d_o}+ \frac{1}{d_i}$$
$$m = -\frac{d_i}{d_o}$$
$d_i \gt 0$: real image (projectable)
$d_i \lt 0$: virtual image (non-projectable)
$m \lt 0$: inverted $m \gt 0$: upright
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| \gt 1$, the image is magnified; if $|m| \lt 1$, it is diminished. The sign of $m$ indicates orientation: $m \lt 0$ means the image is inverted relative to the object; $m \gt 0$ means it is upright.
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 \lt f$), the lens produces a virtual, upright, and magnified image ($m \gt 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$.
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.
Converging lens with f = 40mm, object at do = 120mm (3× focal length). Solving 1/40 = 1/120 + 1/di gives di = 60mm (real image, 60mm beyond lens). Magnification m = –60/120 = –0.5×, producing an inverted, half-size image. Ray diagram displays object arrow, three principal rays converging at image plane, confirming real-image formation used in camera optics and projection systems.