Ray Diagrams and Lens Equations: A Complete Geometric Optics Reference
opticslensesray diagramsgeometric opticswaves and optics

Ray Diagrams and Lens Equations: A Complete Geometric Optics Reference

PPhysics College Editorial Team
2026-11-17
8 min read

Learn to use ray diagrams and the thin-lens equation to locate images, determine magnification, and identify real or virtual results.

Ray diagrams and the thin-lens equation provide two complementary ways to determine the image formed by a converging or diverging lens. This reference gives you a repeatable workflow for locating an image, deciding whether it is real or virtual, calculating its size and orientation, and checking whether your sketch agrees with the algebra.

Overview

Geometric optics treats light as rays that travel in straight lines through a uniform medium and change direction when they reflect or refract. For a thin lens, the image can be predicted with a small set of principal rays and verified with the thin-lens equation.

A converging lens, also called a convex lens, is thicker near its center and brings initially parallel rays toward a principal focus. A diverging lens, or concave lens, is thinner near its center and spreads parallel rays outward. In an ideal thin-lens model, the lens is represented by a vertical line, its optical axis is horizontal, and the focal points lie on the axis at equal distances on opposite sides of the lens.

The most useful principal rays for a converging lens are:

  • A ray parallel to the principal axis refracts through the focal point on the far side of the lens.
  • A ray passing through the optical center continues approximately straight without a significant change in direction.
  • A ray passing through the near focal point emerges parallel to the principal axis.

For a diverging lens, a parallel incident ray emerges as if it came from the focal point on the object side. The ray through the optical center remains approximately straight. A third useful ray is directed toward the far focal point and emerges parallel to the axis.

Two rays are normally enough to locate the image. A third ray is a check, not a requirement. If refracted rays actually meet, the image is real and can be projected onto a screen. If the rays spread apart but their backward extensions meet, the image is virtual and cannot be formed on a screen placed at that apparent location.

How to estimate

Use this workflow for most geometric optics problems:

  1. Draw the optical setup. Mark the lens, principal axis, focal points, and object. Put the object arrow perpendicular to the axis.
  2. Measure or identify the focal length. For a converging lens, the focal length is conventionally positive in the common real-is-positive sign convention. For a diverging lens, it is negative.
  3. Place the object relative to the focal points. For a converging lens, note whether the object is beyond 2f, at 2f, between f and 2f, at f, or inside f.
  4. Draw two principal rays. Extend the refracted rays until they meet, or extend them backward if they diverge.
  5. Use the thin-lens equation. Solve for the image distance and interpret its sign.
  6. Calculate magnification. Use the result to determine image orientation and relative size.
  7. Compare the sketch and calculation. A diagram is an estimate; the equation supplies the numerical result. They should agree qualitatively.

The thin-lens equation is:

1/f = 1/do + 1/di

Here, f is focal length, do is object distance, and di is image distance. Rearranging gives:

di = (f do) / (do - f)

Magnification is:

m = hi/ho = -di/do

The sign of magnification communicates orientation. A positive value indicates an upright image; a negative value indicates an inverted image. The magnitude tells you the size ratio: |m| greater than 1 means enlarged, |m| equal to 1 means the same size, and |m| less than 1 means reduced.

Under the common convention used above, a positive image distance indicates a real image on the side opposite the object, while a negative image distance indicates a virtual image on the object side. Some courses use a Cartesian convention with different signs. The equation structure is unchanged, but the interpretation of positive and negative quantities may differ. Always follow the convention stated in your lecture notes or textbook.

QuantityCommon real-is-positive conventionInterpretation
f > 0Converging lensLens brings parallel rays together
f < 0Diverging lensLens spreads parallel rays apart
di > 0Real imageRefracted rays meet on the far side
di < 0Virtual imageBackward ray extensions meet on the object side
m < 0Inverted imageImage arrow points opposite the object
m > 0Upright imageImage arrow has the same orientation

For mirrors, the same conceptual process applies, but reflection replaces refraction. A spherical mirror is often analyzed with a mirror equation of the same algebraic form, 1/f = 1/do + 1/di, together with a convention for whether the focal length and distances are positive or negative. The principal rays are different: a ray parallel to the axis reflects through the focal point for a concave mirror, while a ray directed toward the focal point reflects parallel to the axis. Confirm whether a problem concerns a lens or a mirror before selecting the ray rules.

Inputs and assumptions

A reliable solution begins by listing the inputs instead of substituting numbers immediately. Record the lens type, focal length, object distance, object height, and the sign convention. Include units for every distance.

The thin-lens model assumes that the lens thickness is small compared with the object and image distances, that the lens is sufficiently close to ideal, and that rays make small enough angles for the paraxial approximation to be useful. Real lenses can introduce spherical aberration, chromatic aberration, distortion, and losses from reflection or absorption. These effects are usually outside an introductory ray-diagram problem, but they explain why a laboratory image may not match a perfect sketch.

Keep the following checks in view:

  • Use one distance unit consistently. Convert centimeters to meters, or vice versa, before calculating.
  • Do not confuse focal length with object distance.
  • Do not assign a positive or negative sign merely because a quantity appears on the left or right of a drawing. Apply the convention deliberately.
  • For a diverging lens with a real object, expect a virtual, upright, reduced image under the usual convention.
  • For a converging lens, the object position relative to f determines whether the image is real or virtual.

When checking precision, avoid reporting more significant figures than the measured inputs justify. The guide Physics Units and Significant Figures: A Calculation-Checking Guide can help with unit and rounding decisions. If the focal length or distances come from a laboratory measurement, uncertainty in those quantities affects the calculated image position; see Propagation of Uncertainty in Physics: Formulas, Rules, and Worked Examples.

Worked examples

Example 1: Converging lens with the object beyond 2f

Suppose a converging lens has f = 10 cm and a real object is placed at do = 30 cm. Since the object is beyond 2f, the ray diagram predicts a real, inverted, reduced image between f and 2f.

Using the thin-lens equation:

di = (10 × 30)/(30 - 10) = 15 cm

The positive image distance confirms a real image. Magnification is:

m = -15/30 = -0.50

The image is inverted and half the object height. The algebra agrees with the diagram: the image is between 10 cm and 20 cm from the lens, and it is smaller than the object.

Example 2: Converging lens with the object inside the focal length

Now let f = 10 cm and do = 6 cm. The object lies inside the focal length. The ray diagram predicts an upright, enlarged, virtual image on the same side of the lens as the object.

di = (10 × 6)/(6 - 10) = -15 cm

The negative image distance indicates a virtual image. Its magnification is:

m = -(-15)/6 = +2.5

The positive magnification indicates an upright image, and the magnitude shows that it is 2.5 times taller than the object. This is the operating principle behind a simple magnifying glass when the object is placed within the focal length.

Example 3: Diverging lens

For a diverging lens, take f = -12 cm and do = 24 cm. Then:

di = (-12 × 24)/(24 - (-12)) = -8 cm

The image is virtual because the image distance is negative. Magnification is:

m = -(-8)/24 = +1/3

The image is upright and one-third the object height. If your sketch shows an upright, reduced image between the lens and the near focal point, it is consistent with the calculation.

Special case: object at the focal point

If a converging-lens object is placed exactly at do = f, the denominator in the rearranged equation becomes zero. In the ideal model, the image is formed at infinity: the outgoing rays are parallel and do not meet at a finite distance. In a practical setup, small alignment errors and lens imperfections determine what you observe.

When to recalculate

Revisit the calculation whenever the focal length, object position, lens type, or sign convention changes. This matters in laboratory work, where moving the object by a small amount can shift the image substantially, especially when the object is near the focal point. Recalculate after changing a lens, reversing the setup, measuring a new focal length, or switching between a course’s lens and mirror conventions.

Before submitting a geometric optics problem or beginning an experiment, use this final checklist:

  1. Identify whether the element is converging, diverging, concave, or convex.
  2. Write the sign convention and assign signs before substitution.
  3. Draw at least two principal rays and label f and 2f where relevant.
  4. Calculate di, then calculate magnification.
  5. State the image’s location, orientation, size, and real-or-virtual status in words.
  6. Compare the equation with the sketch and investigate any contradiction.

If the discrepancy remains, check arithmetic first, then units, then signs, and finally the ray rules. A clear diagram is not decoration: it is a physical interpretation of the equation. Combining both methods makes lens problems easier to solve and gives you a dependable way to catch mistakes before they reach a lab report or exam answer.

Related Topics

#optics#lenses#ray diagrams#geometric optics#waves and optics
P

Physics College Editorial Team

Physics Education Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.