mathematics-in-real-life
The Role of Similar Triangles in Optical Systems and Camera Lens Design
Table of Contents
The Geometric Foundation of Optical Design
Every lens, from a simple magnifying glass to a complex cinema zoom, operates on a single geometric truth: light travels in straight lines. When these straight lines intersect with optical surfaces, they form triangles. By understanding that these triangles are often similar—meaning they share identical angles and proportional side lengths—optical engineers can predict exactly where an image will form, how large it will be, and how the system will behave under different conditions. This relationship is not just a mathematical curiosity; it is the practical skeleton upon which all of optical engineering is built.
When a light ray leaves an object point and strikes a lens, it bends according to Snell's law. If we restrict ourselves to rays that are close to the optical axis (paraxial rays), Snell's law becomes linear, and the geometry becomes exact. The ray forms the hypotenuse of a triangle. The object height and the optical axis form the legs. After refraction, another triangle is formed on the image side. Because the angles of incidence and refraction are fixed relative to the surface curvature, the two triangles created by any single ray crossing the axis are perfectly similar.
Deriving the Thin Lens Equation from Proportions
The thin lens equation, 1/f = 1/do + 1/di, is rarely presented as the purely geometric statement it truly is. It derives directly from the proportionality of two pairs of similar triangles. The first pair compares the object and the image relative to the center of the lens: object height / object distance = image height / image distance. The second pair involves the focal point: object height / focal length = image height / (image distance - focal length). Setting these ratios equal to each other yields the standard lens formula. This derivation is not an abstract exercise; it gives designers an immediate, intuitive sense of how shifting a lens element will change the image.
If an image is too small, the image distance is too short relative to the object distance. Adjusting the lens position changes the triangle proportions, which directly alters magnification. For a photographer, this translates to the relationship between focusing distance and working distance. For an engineer, it is the foundation of first-order optical layout. HyperPhysics provides an excellent visual breakdown of the triangles involved in this derivation.
The Mathematics of Magnification
Magnification M = -di / do is the most direct consequence of the similar triangle ratio. The negative sign simply indicates that real images are inverted. The magnitude of the magnification is the ratio of the image distance to the object distance. To achieve 1:1 macro magnification, the lens must be positioned such that di = do, which geometrically forces the object to be exactly two focal lengths away from the lens. This is why macro lenses are physically long and extend significantly as they focus closer. The same triangular logic governs how a sensor of a given size will capture the scene. A full-frame sensor and an APS-C sensor placed at the same image plane will record different fields of view simply because the similar triangle extending to the sensor edges cuts off at a different point.
Ray Tracing as Applied Triangle Geometry
Ray tracing is the practical act of applying similar triangles to predict the path of light. In a typical system, two types of rays define the image quality: the marginal ray and the chief ray. The marginal ray starts at the center of the object and passes through the edge of the aperture stop. The chief ray starts at the edge of the object and passes through the center of the aperture stop. The intersection of these rays with the optical surfaces defines a series of interconnected triangles. By solving these triangles using simple proportional math, an engineer can determine the size and location of the image with remarkable accuracy.
The concept of nodal points further refines this geometric model. The front and rear nodal points are the two points in an optical system where the angles of incoming and outgoing rays are equal. This means that a ray entering the front node at a given angle will exit the rear node at the exact same angle, forming a consistent similar triangle relationship between the object space and the image space. This is why panoramic photographers can rotate a lens around its rear nodal point to avoid parallax errors in stitched images.
Advanced Lens Architectures and Variable Geometry
Not all optical systems are simple thin lenses. Complex zoom and telephoto designs rely on variable geometry where the similar triangles shift as lens groups move. Maintaining image quality across these changes requires an intimate understanding of how the triangles interact.
Retrofocus and Wide-Angle Systems
In a standard symmetric lens, the back focal distance (the distance from the last lens surface to the sensor) is roughly equal to the focal length. For a wide-angle lens on an SLR camera, this is a problem. The mirror box occupies the space behind the lens, so the back focal distance must be longer than the focal length. The solution is a retrofocus design, which places a strong negative lens group at the front and a positive group at the rear. The negative group diverges the incoming rays, effectively creating a virtual image that is much further away than the physical object. The positive group then focuses this virtual image onto the sensor. The similar triangles in this case involve virtual object distances, but the proportional math remains exactly the same. Discussions on Photrio frequently explore the geometric trade-offs involved in retrofocus designs.
Telephoto Compression
A telephoto lens achieves a long focal length in a physically short barrel. It does this by using a positive front group and a negative rear group. The front group forms an image, but the rear group intercepts the rays before they converge and spreads them out again. The rear group effectively "magnifies" the image formed by the front group. The similar triangles that define the overall focal length are stretched in the object space but compressed in the physical space. This is why a modern 200mm lens can be a fraction of the length of a 200mm lens from the 1950s. The geometry has been folded.
Zoom Lenses and Dynamic Adjustment
Zoom lenses change focal length by moving lens groups along the axis. As the front group moves, the height and angle of the ray bundle entering the rear group changes. The rear group must be designed to continuously adjust its own geometry to maintain a fixed image plane. This is often achieved through mechanical compensation, where cams precisely control the movement of multiple groups. The mathematics behind these cams is a direct application of similar triangles: as one triangle expands, another must contract proportionally to keep the final image distance constant. A parfocal zoom, which maintains focus across its entire range, is the gold standard of this geometric balance.
Addressing Real-World Geometric Flaws
Ideal similar triangles predict a perfect image. Real lenses suffer from aberrations because the assumptions of paraxial optics break down for rays that pass through the edges of the lens or strike it at steep angles. Correcting aberrations is largely a process of manipulating the geometry to force these stray rays back into their correct triangular positions.
Spherical Aberration and Aspherical Surfaces
Spherical aberration occurs when rays entering the lens at different heights focus at different points along the axis. The marginal rays focus closer to the lens than the paraxial rays. This means the similar triangles for the marginal rays have a different focal length than those for the paraxial rays. The classic solution is to split the lens into multiple elements or to use an aspherical surface, which gradually changes curvature to steer the marginal rays back to the same focal point as the axial rays. This is a physical reshaping of the lens to enforce geometric consistency across the entire aperture.
Chromatic Aberration and the Doublet
Chromatic aberration arises because the refractive index of glass changes with the wavelength of light. Blue light bends more than red light, so the light from a single object point is split into a rainbow of different focal points. The similar triangle for blue light has a shorter focal length than the triangle for red light. An achromatic doublet solves this by combining a positive low-dispersion element (crown glass) with a negative high-dispersion element (flint glass). The negative element spreads the rays in the opposite direction, bringing the red and blue focal points back together. RP Photonics offers a technical overview of how achromatic doublets realign the geometric paths of different wavelengths.
Depth of Field and the Circle of Confusion
Depth of field (DOF) is entirely a geometric function of the circle of confusion. The circle of confusion is the maximum allowable blur spot on the sensor that still appears sharp to the human eye at a given print size. The geometry is simple: an object point that is in perfect focus forms a point on the sensor. An object point that is out of focus forms a disk. The size of that disk is determined by the similar triangles formed between the lens aperture, the focused image plane, and the out-of-focus image plane. The further the object is from the focus plane, the larger the base of the triangle becomes on the sensor.
When a photographer stops down the aperture (uses a smaller f-number), they are physically shortening the base of these out-of-focus triangles, which reduces the blur spot size and increases the depth of field. The hyperfocal distance is the point at which the far limit of the depth of field extends to infinity. This is directly calculable from the similar triangles: H = f^2 / (N * c), where N is the f-number and c is the circle of confusion. Cambridge in Colour provides a visual guide to the geometric basis of depth of field.
Computational Optics and Modern Raytracing
While hand calculations using similar triangles are sufficient for initial design, modern lenses are optimized using software like Zemax, Code V, and OSLO. These programs trace thousands of rays through every surface of a multi-element lens, calculating the precise intersection points. The software then evaluates a merit function, which numerically quantifies how much the actual ray paths deviate from the ideal similar-triangle model. The optimization process systematically adjusts the surface curvatures, thicknesses, and glass types to minimize these deviations.
Even in the age of computational photography, the foundation remains geometric. When a smartphone uses multiple cameras to compute a depth map, it relies on triangulation between two sensors. The disparity between the two images is a direct function of the similar triangles formed by the object and the two camera baselines. Light field cameras extend this idea by capturing the full set of rays passing through the main lens, allowing the user to refocus the image computationally. The mathematics of refocusing is a simple ray reassignment based on the similar triangles of the original light field.
The Enduring Logic of Proportions
Similar triangles are not a simplification of optical theory; they are the theory itself, stripped of unnecessary complexity. Every lens formula, every ray trace, and every aberration correction ultimately references the proportional relationship between sides of a triangle. For the photographer, this geometric intuition explains why a longer lens compresses perspective, why a smaller aperture increases sharpness, and why a macro lens must physically extend. For the engineer, it provides the most reliable framework for translating a performance requirement into a physical design. The light does not lie, and the triangles do not break.