The engineering question

A camera often needs an image of a sample at a different location and scale. Two lenses let us relay that image while choosing its magnification. Where should the sensor go if the sample moves, or if the lens spacing changes during alignment?

We will analyze this system in three stages: establish a simple baseline, trace rays to visualize what changes, and derive a formula that explains the behavior. This is a useful route for studying more complicated optical systems, too.

Define the system and its distances

Consider two centered converging thin lenses in air, with focal lengths f_1>0 and f_2>0. Put lens 1 at z=0 and lens 2 at z=s. The positive distance d_1 places the object at z_\mathrm{o}=-d_1. The image lies a signed distance d_2 from lens 2, at z_\mathrm{i}=s+d_2.

A positive d_2 gives a real image downstream of lens 2, where a sensor can be placed. A negative value describes a virtual image found by backward extension of the outgoing rays. Heights and ray angles retain the signed convention of Chapter 1.2.

  • Use paraxial rays in one meridional plane and the same length unit throughout.
  • Model each lens as thin. Aperture clipping, aberrations, and diffraction are omitted.
  • When we report magnification, we mean the height ratio at the focused image plane, not at an arbitrarily fixed sensor.

The 4-f relay is a useful baseline

Place the object in the front focal plane of lens 1 and the image in the back focal plane of lens 2. Separate the lenses by the sum of their focal lengths:

d_1=f_1,\qquad s=f_1+f_2,\qquad d_2=f_2,\qquad M_0=-\frac{f_2}{f_1}

For equal focal lengths f, the four successive focal-length intervals span a total object-to-image distance 4f, giving the name 4-f system. We use the same relay geometry for unequal focal lengths.

A two-lens relay with the object one focal length before lens 1, lens separation f1 plus f2, and an inverted image one focal length after lens 2. Rays from one object point are parallel between the lenses.
Figure 1.5. Here f_1=100~\mathrm{mm} and f_2=150~\mathrm{mm}, giving M_0=-1.5. In the baseline relay, lens 1 collimates the rays from each object point and lens 2 focuses them into the image plane. Different object heights correspond to different directions of the parallel bundles.

Collimated does not mean every ray in the whole image travels in one direction. For a point at height x_\mathrm{o}, the bundle between the lenses has angle -x_\mathrm{o}/f_1. Lens 2 converts this direction into image height x_\mathrm{i}=-f_2x_\mathrm{o}/f_1. The negative sign means the image is inverted.

Perturb the geometry and watch the image

First move the object while keeping the lenses at their baseline separation. Predict whether the best-focus plane moves toward or away from lens 2, and whether the focused image changes size. Then change the lens separation and repeat the same object motion.

Explore: a two-lens relay away from 4-f

Start with Keep sensor at d₂ = f₂ to see the rays spread when the image plane moves away from the sensor. Switch to Follow best focus to track the image plane. Here “fixed” means 150 mm after lens 2, so the sensor moves with lens 2 when their assembly is translated. The focal lengths are 100 mm and 150 mm, matching Figure 1.5. The plots sweep object position at the selected lens spacing; the marked point shows the current configuration. Reset returns to the 4-f baseline.

Keep two observations separate: the location and magnification of the focused image, and the spread of rays on a sensor that has stayed in place. Refocusing can restore a sharp image even when its location has changed.

Lee’s equation: a compact formula explains the behavior

Measure each change relative to the baseline:

\alpha=\frac{d_1}{f_1}-1,\qquad \beta=\frac{s}{f_1+f_2}-1,\qquad M_0=-\frac{f_2}{f_1}

Thus \alpha>0 moves the object farther upstream from lens 1, while \beta>0 separates the lenses farther than f_1+f_2. Define the dimensionless denominator Q:

Q=1+(M_0-1)\beta\alpha
\frac{M}{M_0}=\frac{1}{Q},\qquad \frac{d_2}{f_2}-1=\frac{M_0\alpha}{Q}\quad(Q\ne0)

These results follow from multiplying the propagation and lens matrices, setting B=0 to locate the image, and evaluating A there to find magnification. They are exact within this paraxial thin-lens model; the deviations \alpha and \beta have not been Taylor-expanded.

Read the full derivation → Every matrix multiplication and normalization step is shown on a separate supporting page.

How object position and lens spacing affect the image

At the complete baseline, \alpha=\beta=0, so Q=1, M=M_0, and d_2=f_2. The three cases below show what changes when we move away from this baseline:

  • Move the object with baseline lens spacing: \beta=0 gives M=M_0 and d_2=f_2(1+M_0\alpha). The focused image moves but keeps its magnification. A fixed sensor generally becomes defocused.
  • Change lens spacing with the object in the front focal plane: \alpha=0 gives d_2=f_2 and M=M_0 for any allowed spacing. The rays remain collimated between the lenses. The image stays one focal length after lens 2; its absolute coordinate moves if lens 2 moves.
  • Change both: the product \alpha\beta changes Q. For positive focal lengths, M_0-1<0. Increasing positive \alpha at positive \beta reduces Q and increases |M| while Q>0.

Figure 1.6 illustrates these relationships for three baseline magnifications. The same trends hold across the columns, while the sensitivity to object position changes with the focal-length ratio. The middle column matches Figure 1.5 and the explorer.

Six plots compare baseline magnifications minus 0.5, minus 1.5, and minus 2. The top row shows normalized magnification against object-distance deviation; the bottom row shows normalized image-distance shift. Three line styles distinguish shorter, baseline, and longer lens spacing. At baseline spacing magnification stays constant, while the image plane moves toward lens 2 as object distance increases; the shift is greater for larger baseline magnification magnitude.
Figure 1.6. Two-lens behavior near the 4-f baseline. Columns vary M_0=-f_2/f_1; curves vary lens-spacing deviation \beta. The upper row shows M/M_0, and the lower row shows d_2/f_2-1. A negative value in the lower row means the image is closer to lens 2 than its back focal plane. All curves describe the refocused image, and all plotted configurations have a real image downstream of lens 2.
Beyond the baseline: singularities and virtual images

These cases lie beyond the modest departures from the 4-f baseline considered above. They are not needed for the examples that follow, but they complete our interpretation of the formulas by showing when the image moves to infinity or becomes virtual.

For the same focal lengths as Figure 1.5, increase the lens separation to s=500~\mathrm{mm}. Then M_0=-1.5 and \beta=1, so

Q=1-2.5\alpha,\qquad \frac{M}{M_0}=\frac{1}{1-2.5\alpha},\qquad \frac{d_2}{f_2}=1-\frac{1.5\alpha}{1-2.5\alpha}\quad(Q\ne0)
Two plots show normalized magnification and image distance for baseline magnification minus 1.5 and lens-spacing deviation beta equals one. The image reaches lens 2 at alpha equals 0.25, is virtual between alpha 0.25 and 0.4, and is at infinity at the pole alpha equals 0.4. Just above the pole the real image is far downstream. Curves are separated at the pole and clipped at the plotted vertical limits.
Figure 1.7. A larger lens separation reveals a virtual-image interval and an image at infinity. Unlike Figure 1.6’s lower row, the image-distance axis here shows d_2/f_2 directly, so its sign distinguishes real and virtual images. The curves continue beyond the displayed vertical limits; the vertical asymptote is not a finite image position.
  • A finite virtual image: at \alpha=0.25, the image reaches the plane of lens 2. For 0.25<\alpha<0.4, d_2<0: the emerging rays diverge, and their backward extensions meet upstream of lens 2. A downstream sensor cannot be placed at that virtual image.
  • An image at infinity: at \alpha=0.4, Q=0. Rays from each object point emerge parallel. There is no finite image plane or finite transverse magnification to report; the formulas with 1/Q cannot be evaluated there.
  • A distant real image: just above \alpha=0.4, d_2 is large and positive. The rays converge far downstream, and small object-position changes produce large changes in focus and magnification. Here M>0, so the image is upright.

A singularity does not by itself imply that ray angles have become large or that the paraxial approximation has failed. Check the actual ray angles and aperture clearance separately. These formulas locate an image within the model; they do not guarantee that a practical system can collect the rays or accommodate the required sensor position.

Worked examples

Guided

Choose a baseline relay

A sample feature is 0.50~\mathrm{mm} above the axis. Choose a baseline relay with f_1=100~\mathrm{mm} and f_2=150~\mathrm{mm}. Where are the lenses and sensor relative to lens 1, and what is the image height?

Hint / setup

Use the baseline distances before multiplying any matrices. Convert the object distance to its signed axial coordinate.

Full solution
z_\mathrm{o}=-100~\mathrm{mm},\quad z_{L_2}=250~\mathrm{mm},\quad z_\mathrm{i}=400~\mathrm{mm}
M_0=-\frac{150}{100}=-1.5,\qquad x_\mathrm{i}=(-1.5)(0.50~\mathrm{mm})=-0.75~\mathrm{mm}

The sensor is 150 mm after lens 2. The image is inverted and 1.5 times taller.

Scaffolded

Move a sample and refocus

Two lenses have f_1=f_2=100~\mathrm{mm} and separation s=200~\mathrm{mm}. Move the object from 100 mm to 110 mm before lens 1. Where does it focus, and does its magnification change?

Hint / setup

Compute \alpha and \beta. The lens separation is still at its baseline value.

Full solution
\alpha=\frac{110}{100}-1=0.10,\qquad\beta=0,\qquad M_0=-1,\qquad Q=1
d_2=100(1-0.10)~\mathrm{mm}=90~\mathrm{mm},\qquad M=-1

The sensor must move 10 mm toward lens 2. The refocused image keeps its size and inversion. Leaving the sensor 100 mm after lens 2 gives defocus, not a new focused magnification.

Independent

Change both object position and spacing

Keep f_1=f_2=100~\mathrm{mm} and d_1=110~\mathrm{mm}, but use s=220~\mathrm{mm}. Find the focused image distance and magnification. Explain the difference from the previous example.

Hint / setup

The two normalized deviations are now nonzero. Evaluate Q before solving for the image plane.

Full solution
\alpha=0.10,\quad\beta=0.10,\quad M_0=-1,\quad Q=1-2(0.10)(0.10)=0.98
M=-\frac{1}{0.98}\approx-1.0204
d_2=100\left(1-\frac{0.10}{0.98}\right)~\mathrm{mm}\approx89.796~\mathrm{mm}

The real image is about 89.8 mm after lens 2, at z_\mathrm{i}\approx309.796~\mathrm{mm} relative to lens 1. Its magnitude of magnification is about 2.04% above the baseline. Changing lens spacing affects magnification here because the object is also displaced from the front focal plane.

Model selection and engineering checks

  • Are all traced angles small, including those after each lens? Is the real lens adequately modeled as thin?
  • Do d_1,s,d_2,f_1,f_2 use the same length unit? \alpha,\beta,Q,M must be dimensionless.
  • Does the result recover d_2=f_2 and M=-f_2/f_1 at the baseline?
  • Is the calculated d_2 positive, and is there room for the sensor there?
  • Is Q near zero, making the system sensitive to small position errors?
  • At the predicted plane, do independently traced rays from one object point share the same height? Check this before trusting a compact formula.
  • Do the actual lenses pass the ray bundle? A focused paraxial solution alone does not guarantee enough light reaches the sensor.