A Byte of PhysicsLogo

Mirrors and lenses

A mirror or lens is a transformation from incoming ray to outgoing ray. Ray diagrams let you trace that transformation without simulating every electromagnetic wave. They are useful only when the object, aperture, and surfaces are large compared with the light's wavelength.

Think like a programmer

Think of an optical system as an ordered pipeline. A ray carries an origin and direction; each element returns a new direction and perhaps a new origin. The thin-lens equation is a contract for a very small, ideal element. Its signed output matters: a negative image distance describes a virtual image, not a failed calculation.

Model checklist

Inputs
Object distance dₒ and focal length f in centimetres, plus a sign convention.
State
An optical axis, an ideal lens plane, object height, and a small set of principal rays.
Rule
Use the ideal thin-lens relation to solve for signed image distance dᵢ, then use magnification to scale and orient the image.
Output
Real or virtual image position, orientation, and relative height.
Check
At dₒ = 2f, the image is real, inverted, and the same size; at dₒ = f, the outgoing rays are parallel.

For a thin converging lens, the paraxial ray model says

\[\frac{1}{f}=\frac{1}{d_{\mathrm{o}}}+\frac{1}{d_{\mathrm{i}}}\]

Here f is positive focal length, dₒ is positive object distance, and dᵢ is signed image distance. Solve it as a function whose special case is explicit:

function imageDistance(objectDistance: number, focalLength: number) {
  const inverseImageDistance = 1 / focalLength - 1 / objectDistance;
  return Math.abs(inverseImageDistance) < Number.EPSILON * 32
    ? null // parallel rays: image at infinity in this ideal model
    : 1 / inverseImageDistance;
}

The magnification check is

\[m=\frac{h_{\mathrm{i}}}{h_{\mathrm{o}}}=-\frac{d_{\mathrm{i}}}{d_{\mathrm{o}}}\]

At dₒ = 30 cm and f = 10 cm, the equation gives dᵢ = 15 cm and m = −0.5. The minus sign predicts an inverted image half as tall as the object. At dₒ = 5 cm and the same focal length, dᵢ = −10 cm: the rays diverge after the lens but their backward extensions meet on the object side, so the image is upright and virtual.

Ideal thin-lens ray experiment

Move the object and focal length. Distances are in centimetres. The object and lens are idealized; arrow directions show image orientation.

FF
Object, real image, and principal rays
Virtual-ray extensions
Lens, axis, and focal points

Real image: 20.0 cm beyond the lens; magnification -0.67.

The labels report the same ideal-lens calculation: object distance, focal length, signed image distance, and magnification.

The diagram uses only a few principal rays. That is deliberate. Its goal is to make the equation's branches visible, not to render photorealistic glass. The accompanying tests ask for the 2f case, the focal-plane null case, and a virtual-image case so a drawing cannot silently hide a sign mistake.

Try this experiment

Prediction: Moving the object from beyond twice the focal length toward the lens makes a real image move farther away and grow before it becomes virtual.

Set the focal length to 12 cm. Compare object distances of 36 cm, 24 cm, 18 cm, 12 cm, and 8 cm. Before moving each slider, predict the image type, orientation, and whether its distance should increase or decrease. At 12 cm, explain why the result is not a huge finite number.

Where this model breaks

The thin-lens formula assumes small angles, a lens whose thickness is negligible, a uniform refractive index, and rays close to the optical axis. It omits spherical and chromatic aberration, diffraction, finite apertures, coatings, sensor response, and wave interference. A real camera lens is many elements optimized to control exactly these omitted effects.

Summary

Ray optics makes an optical system testable: trace a few labelled rays, solve a signed distance equation, and compare the diagram with focal-point limiting cases. Treat “image at infinity” and “virtual image” as model outputs with meaning, not UI errors.

Glossary

Self-check

  1. What does a negative image distance mean in this sign convention?
  2. What occurs in the thin-lens model when object distance equals focal length?
  3. Why does a sign error in magnification change the diagram in a useful, detectable way?

Sources

Model contract

Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.

\[\text{observable output} = f(\text{inputs},\,\text{state})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

For Mirrors and Lenses, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Geometric and Wave Optics, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.

Guided experiment

Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.

Where this model breaks

This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.

Summary

Treat Mirrors and Lenses as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Mirrors and Lenses into a test

Compose ideal optical elements as explicit ray-transform functions with focal reference tests.

  1. Name the inputs and units that the geometric and wave optics model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: