Thin Lens Equation
$$\frac{1}{f}= \frac{1}{d_o}+ \frac{1}{d_i}$$Magnification: $m = -\dfrac{d_i}{d_o}$
$d_i > 0$: real image $d_i < 0$: virtual image
$|m| > 1$: magnified $|m| < 1$: reduced
Drag sliders to watch three principal rays update in real time. Instantly see image distance, magnification, and whether the image is real or virtual for convex and concave lenses.
Magnification: $m = -\dfrac{d_i}{d_o}$
$d_i > 0$: real image $d_i < 0$: virtual image
$|m| > 1$: magnified $|m| < 1$: reduced
The fundamental law governing a single ideal thin lens is the Gaussian Lens Formula. It assumes the lens thickness is negligible and uses the paraxial approximation (small angles).
$$\frac{1}{f}= \frac{1}{d_o}+ \frac{1}{d_i}$$$f$: Focal length of the lens. $f > 0$ for converging (convex) lenses, $f < 0$ for diverging (concave) lenses.
$d_o$: Object distance (positive if object is on the side from which light is coming).
$d_i$: Image distance. $d_i > 0$ indicates a real image (formed on the opposite side of the lens). $d_i < 0$ indicates a virtual image (formed on the same side as the object).
The lateral magnification $m$ tells you the size and orientation of the image relative to the object. It is derived from similar triangles in the ray diagram.
$$m = -\frac{d_i}{d_o}= \frac{h_i}{h_o}$$$m$: Magnification. $|m| > 1$ means the image is larger than the object. The sign of $m$ indicates orientation: $m > 0$ means the image is upright, $m < 0$ means the image is inverted.
$h_o$, $h_i$: Object height and image height, respectively.
Camera Lens Design: Engineers use these exact ray-tracing principles to design lens elements. By combining multiple lenses with different focal lengths and separations, they correct for aberrations and focus light precisely onto a camera sensor. The "Two-Lens System" mode in this simulator is a foundational model for such compound lenses.
Microscopes & Telescopes: These instruments are essentially precise arrangements of two or more lenses. A microscope uses a short-focal-length objective lens to create a magnified real image, which is then viewed through an eyepiece (acting as a magnifying glass). The overall magnification is the product of the magnifications of each stage.
Vision Correction (Eyeglasses): A prescription lens is designed to take an object at a desired distance (e.g., a book at 25 cm for a presbyopic eye) and form a virtual image at the eye's own far point, allowing the eye to focus it properly. This simulator helps visualize how concave or convex lenses shift the apparent image location.
Illumination & Optical Sensor Systems: In automotive lighting, projectors, or barcode scanners, engineers use geometrical optics to direct light from a source (like an LED) through lenses to create a specific beam pattern or to focus light onto a detector. This is a core CAE application for ensuring efficiency and performance before physical prototyping.
First, understand that the "thin lens" concept does not negate real-world lenses. Actual lenses have thickness and aberrations. This simulator is an "ideal first-order approximation model." For example, smartphone camera lenses use multiple cemented elements to cancel aberrations, but their initial design is based on this thin lens model. Next, strict adherence to sign conventions is critically important. If you input a positive focal length for a concave lens or consider the distance to a virtual image as positive, all calculations will be off. Even when using professional optical design software, this convention is often the default setting. Third, avoid setting the lens separation too extremely in "Two-Lens Mode." For instance, bringing a 10cm and a 5cm focal length lens as close as 1cm causes rays to bend sharply, making the image appear behind the lens. This is an unrealistic combination; in actual microscopes, there is a specific fixed distance called the "tube length" between the objective and eyepiece lenses.
The core technique of this simulator, "ray tracing," is a fundamental method underlying various CAE fields. The most direct application is illumination optical design. For systems like car headlamps or projector optics, designers trace tens of thousands of rays from the light source (LED or lamp) as they travel through lenses and mirrors to achieve the required light distribution pattern. Next is the optical design for semiconductor lithography systems (steppers). Extremely complex multi-lens groups image a mask's fine pattern onto a silicon wafer with minimal distortion, and geometric optics models are used in the foundational design stages. Broadening the view, the same concept applies to radio wave and acoustic propagation analysis. For example, designing a reflector to focus radio waves from an antenna or simulating acoustics in a concert hall uses "ray tracing methods," where "electromagnetic waves" or "sound rays" are traced instead of "light." Thus, for modeling phenomena where structures are large compared to the wavelength, ray tracing is the starting point.
Once you're comfortable with this simulator, the next step is to explore the world of "thick lenses" and "aberrations." While a thin lens has a single focal length, a real lens has front/back surface radii of curvature and thickness. This introduces the concept of "principal points," from which object and image distances must be measured. The fastest way to understand this is to manually calculate the actual refraction of rays (sequential application of Snell's Law) using trigonometry. For example, calculate where a parallel ray entering a plano-convex lens at a slight height above the optical axis intersects it. This lets you experience the deviation from the ideal focal point (spherical aberration). To learn further, consider the effects of "diffraction" as a bridge to wave optics. Diffraction, which occurs precisely because a lens has a finite aperture, ultimately determines image sharpness (resolution). Understanding why what images as a "point" in this thin lens simulator actually becomes a blurred disc called an "Airy disk" in reality will double the fun of optical design.