PHYSICS 2 • WAVES AND OPTICS

Ray Tracing

A geometric method for predicting image location, size, and orientation formed by mirrors and lenses.

Historical Context & Motivation

The desire to understand how light interacts with curved surfaces and transparent media is one of the oldest problems in natural philosophy. Long before the electromagnetic theory of Maxwell or the wave optics of Huygens, scholars recognized that light travels in straight lines under ordinary conditions — a simplification that, remarkably, yields highly accurate predictions for lenses and mirrors whose dimensions are much larger than the wavelength of visible light. Ray tracing is the systematic, graphical technique that exploits this rectilinear behavior, allowing us to locate and characterize images formed by optical elements without resorting to wave equations.

~300 BCE
Euclid's Optica
Euclid codified the law of reflection and the principle of rectilinear propagation, establishing the geometric foundation upon which all ray-tracing methods ultimately rest.
1021
Alhazen's Book of Optics
Ibn al-Haytham (Alhazen) introduced experimental methodology to optics, correctly explaining image formation through pinholes and curved mirrors, and arguing that light rays originate at objects rather than the eye.
1611
Kepler's Dioptrice
Johannes Kepler developed a systematic ray-based analysis of converging and diverging lenses, laying the groundwork for modern refracting telescope design and the thin-lens approximation.
1637
Descartes and Snell's Law
René Descartes published the sine law of refraction (independently discovered by Willebrord Snell), providing the precise quantitative rule that governs ray bending at interfaces between media of different refractive indices.
1840s–Present
Systematic Optical Design
With the formalization of the thin-lens and mirror equations, graphical ray tracing became a standard pedagogical and engineering tool, later extended by computational ray-tracing software used in modern optical design and computer graphics.

The central question that ray tracing addresses is deceptively simple: given an object placed in front of a mirror or lens, where does the image form, how large is it, and is it upright or inverted? While the thin-lens and mirror equations answer these questions algebraically, ray tracing provides a complementary geometric intuition that reveals not just the numerical answer but the physical reasoning behind it. Mastery of both approaches — graphical and algebraic — is essential for any serious study of optics.

Core Principles of Ray Tracing

Ray tracing operates entirely within the framework of geometric optics, the regime in which the wavelength of light is negligibly small compared to the dimensions of the optical elements. In this limit, light can be modeled as rays — straight lines that change direction only upon reflection or refraction. The technique requires the identification of a small number of principal rays whose behavior is dictated entirely by the geometry of the optical element and its focal length. The intersection of any two of these principal rays determines the image point corresponding to a given object point.

1

Rectilinear Propagation

In a homogeneous medium, light travels in straight lines. This allows us to represent each light path as a simple geometric ray, ignoring diffraction and interference effects.
2

Principal Rays

For thin lenses and spherical mirrors, three special rays have predictable paths: the parallel ray, the focal ray, and the center (or vertex) ray. Any two suffice to locate the image.
3

Sign Conventions

Consistent sign conventions (e.g., real-is-positive for mirrors, Cartesian for lenses) ensure that distances, focal lengths, and magnifications carry the correct physical meaning.
4

Image Classification

Images are classified as real (rays converge) or virtual (rays diverge but appear to converge), and as upright or inverted. Ray diagrams make these distinctions visually transparent.
5

Thin-Lens / Mirror Approximation

Ray tracing in introductory optics assumes that lenses are thin (refraction occurs at a single plane) and mirrors are paraxial (rays make small angles with the optical axis), simplifying the geometry considerably.
KEY TAKEAWAY
Think of ray tracing like triangulating a signal in GPS: you don't need to track every possible ray from the object — just two or three carefully chosen ones whose paths are already known by the rules of the system. Where those special rays cross, you've pinpointed the image. The entire technique is a geometrical shortcut that sidesteps the complexity of tracking billions of photons.

Ray Diagram for a Converging Lens

The following diagram illustrates the three principal rays for a converging (convex) thin lens when the object is placed beyond the focal point. The object is represented by an upward-pointing arrow on the left side of the lens, and the resulting image appears on the right side. Each principal ray follows a deterministic path through the lens, and their mutual intersection defines the tip of the image arrow.

Three principal rays for a converging lens: ① the parallel ray travels parallel to the axis and refracts through F'; ② the center ray passes through the lens center undeviated; ③ the focal ray passes through F on the object side and emerges parallel, then all three converge at the image point.

In the diagram above, the object (pink arrow) is located at a distance greater than the focal length f from the lens. The parallel ray enters horizontally and, upon refraction through the lens, bends toward the far focal point F'. The center ray passes through the optical center of the thin lens and continues in a straight line — this is a consequence of the thin-lens approximation in which the two refractions (entering and exiting the lens) produce zero net lateral displacement. The focal ray is directed through the near-side focal point F, and after refraction it exits parallel to the optical axis. All three rays converge at the tip of the image, confirming that the image is real, inverted, and located on the far side of the lens.

Mathematical Framework

While ray diagrams provide geometric intuition, the quantitative predictions of image position and magnification are encoded in two fundamental equations. For thin lenses, the relationship between object distance, image distance, and focal length follows from the geometry of similar triangles that emerges naturally from the ray diagram. For spherical mirrors, an analogous relation holds, with the focal length equal to half the radius of curvature. The sign conventions must be stated explicitly, as different textbooks use different systems; we adopt the standard convention where distances measured in the direction of the incoming light are positive.

THIN-LENS EQUATION
1/s + 1/s' = 1/f
Here s is the object distance (positive when the object is on the incoming-light side), s' is the image distance (positive when the image is on the outgoing-light side), and f is the focal length (positive for converging lenses, negative for diverging lenses).
MIRROR EQUATION
1/s + 1/s' = 1/f = 2/R
For a spherical mirror, R is the radius of curvature and f = R/2. Distances are positive on the reflecting (front) side of the mirror. A concave mirror has positive f; a convex mirror has negative f.
LATERAL MAGNIFICATION
m = −s'/s = h'/h
The magnification m gives the ratio of image height h' to object height h. When m is negative the image is inverted; when |m| > 1 the image is enlarged.

These equations are not merely computational shortcuts; they are direct algebraic expressions of the geometric relationships visible in a ray diagram. The derivation of the thin-lens equation, for instance, proceeds by writing similar-triangle ratios from the parallel ray and the center ray, then eliminating the image height to obtain the reciprocal relation. The sign of the magnification captures the orientation information that is immediately apparent in a ray diagram — a negative m corresponds to an inverted image, and a positive m to an upright one. Mastering the interplay between the graphical and algebraic viewpoints is the hallmark of a strong understanding of geometric optics.

Ray Tracing for Concave and Convex Mirrors

The principal-ray rules for mirrors differ from those for lenses in one critical respect: reflected rays return to the same side of the optical element as the incident rays. For a concave mirror (positive focal length), the three principal rays are: (1) a ray parallel to the axis reflects through the focal point F; (2) a ray through F reflects parallel to the axis; and (3) a ray directed at the center of curvature C reflects back along itself. For a convex mirror (negative focal length), the focal point and center of curvature lie behind the mirror, so the reflected rays only appear to originate from those points when extended backward as virtual rays.

Concave mirror with an object beyond C. The parallel ray reflects through F, the focal ray reflects parallel to the axis, and the center-of-curvature ray reflects back on itself. The image forms between F and C, real, inverted, and smaller than the object.
Summary of image characteristics for spherical mirrors as a function of object placement.
Object LocationImage LocationImage TypeOrientation & Size
Beyond C (concave)Between F and CRealInverted, reduced
At C (concave)At CRealInverted, same size
Between F and C (concave)Beyond CRealInverted, enlarged
At F (concave)At infinityRays emerge parallel
Inside F (concave)Behind mirrorVirtualUpright, enlarged
Any position (convex)Behind mirrorVirtualUpright, reduced

Worked Example: Converging Lens

A 3.0 cm tall object is placed 30.0 cm in front of a converging thin lens of focal length 12.0 cm. Determine the image distance, the magnification, the image height, and the nature of the image. Then verify the result with a ray-tracing argument.

Converging Lens — Object at 30.0 cm
1
Step 1 — Identify Given ValuesObject distance: s = +30.0 cm (real object, positive). Focal length: f = +12.0 cm (converging lens, positive). Object height: h = +3.0 cm.
2
Step 2 — Apply the Thin-Lens EquationStarting from 1/s + 1/s' = 1/f, we solve for s': 1/s' = 1/12.0 − 1/30.0 = (30.0 − 12.0)/(12.0 × 30.0) = 18.0/360.0 = 1/20.0.
s' = +20.0 cm
3
Step 3 — Compute the MagnificationUsing m = −s'/s = −20.0/30.0 = −0.667. The negative sign confirms the image is inverted.
m = −0.667
4
Step 4 — Determine the Image Heighth' = m × h = (−0.667)(3.0 cm) = −2.0 cm. The magnitude tells us the image is 2.0 cm tall; the negative sign reconfirms inversion.
h' = −2.0 cm (inverted, reduced)
5
Step 5 — Ray-Tracing VerificationSince s = 30.0 cm > 2f = 24.0 cm, the object lies beyond 2F. A ray diagram for this configuration shows the three principal rays converging on the far side of the lens between F' and 2F', producing a real, inverted, reduced image — fully consistent with the algebraic solution.
Image: real, inverted, reduced, at 20.0 cm on far side ✓

Comparing Ray Tracing for Lenses and Mirrors

Although the algebraic equations for thin lenses and spherical mirrors have the same reciprocal form, the ray-tracing procedures differ in important ways. The most fundamental difference is that lenses transmit light (refraction) while mirrors redirect it (reflection), which affects which side of the optical element the image forms on. Understanding these distinctions prevents the sign-convention errors that plague many optics students.

Side-by-side comparison of ray-tracing procedures and characteristics for thin lenses versus spherical mirrors.
FeatureThin LensSpherical Mirror
Physical mechanismRefraction (light passes through)Reflection (light bounces back)
Real image locationOpposite side from objectSame side as object (in front of mirror)
Virtual image locationSame side as objectBehind the mirror
Center ray rulePasses through lens center undeviatedAimed at C; reflects back on itself
Converging elementConvex (double-convex) lens, f > 0Concave mirror, f > 0
Diverging elementConcave (double-concave) lens, f < 0Convex mirror, f < 0
Chromatic aberrationPresent (different n for different λ)Absent (reflection is wavelength-independent)
KEY TAKEAWAY
The lens and mirror equations are algebraically identical twins — both use 1/s + 1/s' = 1/f — but the sign conventions encode fundamentally different geometries. Think of the sign convention as a coordinate system: once you define the positive direction (toward outgoing light for lenses, toward incoming light for mirrors), the algebra does the rest. Mixing conventions is like plugging GPS coordinates from the southern hemisphere into a northern-hemisphere map — the math works, but the answer is physically meaningless.

Connection to Advanced Optics

The ray-tracing methods presented in this lesson are valid within the paraxial approximation — the assumption that all rays make small angles with the optical axis so that sin θ ≈ θ. Real optical systems routinely violate this condition, and the deviations from the paraxial predictions are called aberrations. Understanding where introductory ray tracing breaks down is essential for transitioning to more advanced coursework in optical engineering, astrophysics instrumentation, or photonics.

Paraxial (introductory) ray tracing versus exact ray tracing used in advanced optical design.
Paraxial Ray TracingAdvanced / Exact Ray Tracing
sin θ ≈ θ; all rays focus to a single pointExact Snell's law applied; marginal rays focus at different points (spherical aberration)
Single focal length independent of wavelengthRefractive index varies with λ; chromatic aberration splits focal points by color
Thin-lens model: refraction at a single planeThick-lens model: two principal planes, nodal points, and effective focal lengths
Graphical construction with ruler and pencilComputational ray tracing (e.g., Zemax, Code V) traces millions of rays using matrix methods or exact refraction at each surface
Adequate for introductory physics and basic lens/mirror problemsRequired for camera design, telescopes, microscopes, fiber optics, and laser systems

In more advanced courses, you will encounter the ray transfer matrix (ABCD matrix) formalism, which encodes the effect of each optical element as a 2 × 2 matrix acting on a column vector of ray height and angle. This method is a direct extension of the graphical ray tracing you have learned here: the three principal rays correspond to specific eigenvectors or special cases of the matrix product. Wave optics, which accounts for diffraction and interference, becomes necessary when feature sizes approach the wavelength of light, but geometric ray tracing remains the backbone of first-order optical design even at the professional level.

Practice Problems

PROBLEM 1CONCEPTUAL
A diverging lens always produces an image that is virtual, upright, and reduced regardless of where the object is placed. Explain, using the behavior of the three principal rays, why a diverging lens can never produce a real image.
PROBLEM 2BASIC CALCULATION
An object is placed 40.0 cm in front of a concave mirror with a radius of curvature R = 30.0 cm. Find the image distance and state whether the image is real or virtual, upright or inverted.
PROBLEM 3INTERMEDIATE
A 5.0 cm tall object is placed 18.0 cm from a converging lens of focal length 24.0 cm (i.e., the object is inside the focal point). Determine the image distance, magnification, and image height, and describe the nature of the image.
PROBLEM 4APPLIED
A dentist uses a small concave mirror with a focal length of 3.0 cm to examine a cavity. The mirror is held 2.0 cm from the tooth surface. Determine the magnification and describe what the dentist sees. Explain why a concave mirror, rather than a convex one, is chosen for this application.
PROBLEM 5CRITICAL THINKING
Consider a two-lens system in which a converging lens (f₁ = 20.0 cm) is placed 50.0 cm in front of a diverging lens (f₂ = −15.0 cm). An object is placed 30.0 cm in front of the first lens. Using sequential ray tracing (treating the image of the first lens as the object for the second), find the final image position relative to the second lens and describe the final image.

Lesson Summary

Ray tracing is a graphical method rooted in geometric optics that predicts the location, size, orientation, and nature of images formed by thin lenses and spherical mirrors. The technique relies on tracing two or three principal rays — the parallel ray, the focal ray, and the center (or vertex) ray — whose post-interaction paths are determined entirely by the geometry of the optical element and its focal length. Where these rays intersect (or appear to intersect when extended backward), the image forms.

The algebraic counterpart to graphical ray tracing is the thin-lens/mirror equation (1/s + 1/s' = 1/f) together with the magnification equation (m = −s'/s). Consistent sign conventions are essential: positive focal lengths denote converging elements (convex lens, concave mirror), and the sign of the magnification encodes whether the image is upright (+) or inverted (−). Mastering both the graphical and algebraic approaches provides a robust toolkit for image analysis and lays the foundation for advanced topics including aberrations, multi-element systems, and ray transfer matrix methods.

Varsity Tutors • Physics 2 • Ray Tracing