πŸ”­

Geometrical Optics Bench

Build a meridional optical system from lenses, refracting surfaces, mirrors and stops, then compare exact ray tracing (vector Snell's law) with paraxial ABCD matrices. Read off cardinal points, pupils, numerical aperture and the aberrations that the paraxial model leaves out.

Drag the object, elements or detector on the bench β€’ Focus the bench and use ←/β†’ (Shift = 10 mm) to move the selected item
fβ€² β€” Effective focal length
sα΅’ β€” Image distance
m β€” Magnification
NAβ€² β€” Image-space NA
Οƒ β€” RMS spot (exact)

Optical bench (meridional section) exact + paraxial

Light travels left β†’ right. Vertical scale is stretched relative to z when the system is long: angles are not drawn true. Solid coloured: exact rays at each wavelength (they stop where they are vignetted, and turn orange at total internal reflection). Dashed white: paraxial rays. Gold: construction rays drawn with the principal planes. Dashed arrows: virtual images.

Spot diagram skew rays

Hexapolar pupil grid traced in 3D through the rotationally symmetric system. Coordinates are relative to the chief ray. The dashed circle is the Airy first dark ring (0.61 Ξ»/NAβ€²).

Longitudinal aberration on axis

Where a meridional ray at normalised pupil height ρ crosses the axis, relative to the paraxial image at the reference wavelength (the d line when F, d, C are traced). Curvature shows spherical aberration. A sideways offset between colours shows longitudinal chromatic aberration.

Field curvature & astigmatism near-chief rays

Tangential (T, solid) and sagittal (S, dashed) focus vs field, from ray pairs infinitesimally displaced from the exact chief ray. T β‰  S is astigmatism. A common bend is field curvature.

Distortion exact chief ray

(yreal βˆ’ yparaxial)/yparaxial of the chief ray on the paraxial image plane (tangent of the output angle for images at infinity). Negative = barrel, positive = pincushion.

Image and focus

Image distance
β€”
Magnification
β€”
Effective focal length
β€”
Back / front focal distance
β€”

Cardinal points and system matrix

Front / rear focal points (z)
β€”
Front / rear principal points (z)
β€”
Front / rear nodal points (z)
β€”
System ABCD matrix
β€”

Stops and pupils

Aperture / field stop
β€”
Entrance pupil
β€”
Exit pupil
β€”
Field limit Β· 50% vignetting
β€”

Resolution

Object / image numerical aperture
β€”
Working f-number
β€”
Airy diameter
β€”
RMS spot / Airy radius
β€”

Exact vs paraxial near the axis

Meridional rays from the axial object point at pupil fraction ρ. The exact error shrinks as ρ² (third-order spherical aberration) and vanishes as ρ β†’ 0.
ρ Ray height at first surface Exact βˆ’ paraxial Error / ρ²

Surfaces at Ξ»

# Kind z (mm) R (mm) n before β†’ after Semi-aperture (mm) Paraxial marginal y (mm)
πŸ’‘ How to Use

Learn with this tool

Learning objectives

  • Predict image position, size and orientation with ABCD matrices under one sign convention, including virtual images and images at infinity.
  • Locate cardinal points, the aperture and field stops and the pupils, and use them to explain magnifiers, telescopes and microscopes.
  • Tell paraxial predictions from exact ray behaviour. Measure spherical and chromatic aberration and judge when diffraction, not geometry, limits resolution.

Prerequisites

  • Snell's law and total internal reflection (Fresnel equations)
  • 2Γ—2 matrix multiplication
  • Small-angle approximations sin u β‰ˆ tan u β‰ˆ u

How the optical model works

Exact rays: refraction and reflection

Rays travel in straight lines between spherical or plane surfaces. At each surface, the tool finds the intersection, changes the ray direction and clips rays outside the clear aperture. The unit normal N^\hat{\mathbf N} points against the incoming ray.

Refracted direction

dβ€²=Ξ·d+[Ξ·cos⁑iβˆ’1βˆ’Ξ·2(1βˆ’cos⁑2i)]N^\mathbf d^{\prime}=\eta\mathbf d+\left[\eta\cos i-\sqrt{1-\eta^2(1-\cos^2 i)}\right]\hat{\mathbf N}

Here Ξ·=n/nβ€²\eta=n/n^{\prime} and cos⁑i=βˆ’N^β‹…d\cos i=-\hat{\mathbf N}\cdot\mathbf d. If the square root is not real, total internal reflection occurs.

Reflected direction

dβ€²=d+2cos⁑i N^\mathbf d^{\prime}=\mathbf d+2\cos i\,\hat{\mathbf N}

The ideal thin lens changes the ray slope by tan⁑uβ€²=tan⁑uβˆ’y/f\tan u^{\prime}=\tan u-y/f in each plane. It is an aberration-free reference for comparing real spherical surfaces.

Paraxial rays: one height and one slope

For small ray angles, a ray is described by its height yy and slope ΞΈ\theta along its direction of travel. This is the same convention used by the Gaussian Beams tool. Each optical element applies a two-by-two matrix:

(youtθout)=(ABCD)⏟M(yinθin)\begin{pmatrix}y_{\mathrm{out}}\\\theta_{\mathrm{out}}\end{pmatrix}=\underbrace{\begin{pmatrix}A&B\\C&D\end{pmatrix}}_{M}\begin{pmatrix}y_{\mathrm{in}}\\\theta_{\mathrm{in}}\end{pmatrix}

Propagation through distance t

T(t)=(1t01)T(t)=\begin{pmatrix}1&t\\0&1\end{pmatrix}

Refraction from n to nβ€²

S(R)=(10nβˆ’nβ€²nβ€²Rnnβ€²)S(R)=\begin{pmatrix}1&0\\\frac{n-n^{\prime}}{n^{\prime}R}&\frac{n}{n^{\prime}}\end{pmatrix}

Mirror

K(R)=(102R1)K(R)=\begin{pmatrix}1&0\\\frac2R&1\end{pmatrix}

Thin lens with focal length f

L(f)=(10βˆ’1f1)L(f)=\begin{pmatrix}1&0\\-\frac1f&1\end{pmatrix}

After a mirror, the ray reverses its direction of travel. The tool β€œunfolds” the path: curvature signs follow the travel direction, and later distances are measured along that direction.

Finding the image

Multiply the element matrices in the order the ray encounters them. The rightmost matrix acts first:

M=MNβ‹―M2M1,det⁑M=nnβ€²M=M_N\cdots M_2M_1,\qquad\det M=\frac{n}{n^{\prime}}

Include propagation from the object to the system and from the system to the image. A focused image forms when the top-right entry is zero:

Mimage=T(si) M T(so),Bimage=0M_{\mathrm{image}}=T(s_i)\,M\,T(s_o),\qquad B_{\mathrm{image}}=0

For a finite image, its height is the object height multiplied by the magnification. When the image lies at infinity, the tool reports the outgoing slope or angular magnification instead of an infinite image distance.

Symbols and sign conventions

z,β€…β€Šyz,\;y
Axial position and meridional ray height. The screen uses millimetres; calculations use metres. Incoming light travels in the positive z direction.
RR
Surface radius of curvature. R is positive when the centre of curvature lies to the right of the surface vertex.
so,β€…β€Šsis_o,\;s_i
Object distance before the first element and image distance after the last powered surface, measured along the outgoing ray direction. Positive means real; negative image distance means virtual.
n,β€…β€Šnβ€²n,\;n^{\prime}
Refractive indices in the input and output spaces.
P,β€…β€Šf,β€…β€Šfβ€²P,\;f,\;f^{\prime}
System power and front/rear focal lengths. Using the reduced ray vector (ynΞΈ)\begin{pmatrix}y\\n\theta\end{pmatrix}, P=βˆ’CrP=-C_r, f=n/Pf=n/P and fβ€²=nβ€²/Pf^{\prime}=n^{\prime}/P. The effective focal length is EFL=1/P\mathrm{EFL}=1/P.
F,β€…β€ŠH,β€…β€ŠNF,\;H,\;N
Focal, principal and nodal points. Principal planes have unit transverse magnification; nodal points have unit angular magnification. Their displacement obeys Nβˆ’H=(nβ€²βˆ’n)/PN-H=(n^{\prime}-n)/P.
EP,β€…β€ŠXP\mathrm{EP},\;\mathrm{XP}
Entrance and exit pupils: the images of the aperture stop seen from object space and image space.
NAβ€²\mathrm{NA}^{\prime}
Image-side numerical aperture: NAβ€²=nβ€²sin⁑uβ€²\mathrm{NA}^{\prime}=n^{\prime}\sin u^{\prime} for the paraxial marginal ray that just fills the aperture stop.
Ξ»\lambda
Vacuum wavelength. The N-BK7 and F2 glass indices use the Sellmeier equation: n2=1+βˆ‘iBiΞ»2Ξ»2βˆ’Cin^2=1+\sum_i\frac{B_i\lambda^2}{\lambda^2-C_i}.

Assumptions

  • The system is rotationally symmetric and sequential: every ray meets the surfaces in list order.
  • Surfaces are spherical or plane, and materials are lossless. The ray model omits diffraction, polarization effects and Fresnel reflection losses.
  • The bench shows the meridional plane. Spot diagrams, field curves and distortion use three-dimensional skew-ray tracing of the same system.
Derivation: image position, magnification and principal planes

First propagate from the object to the end of the optical system. Call the resulting matrix MoM_o:

Mo=M T(so)=(abcd)M_o=M\,T(s_o)=\begin{pmatrix}a&b\\c&d\end{pmatrix}

Propagating a further distance sis_i makes the top-right entry b+sidb+s_i d. All rays from one object point reach the same image height when this entry vanishes:

si=βˆ’bd,m=a+sic=adβˆ’bcd=det⁑Mds_i=-\frac bd,\qquad m=a+s_i c=\frac{ad-bc}{d}=\frac{\det M}{d}

For a thin lens, b=sob=s_o and d=1βˆ’so/fd=1-s_o/f. Substitution gives the familiar lens equation:

1so+1si=1f\frac1{s_o}+\frac1{s_i}=\frac1f

As d→0d\to0, the image goes to infinity. Each ray from the object top then leaves with the same slope chch, which the tool reports.

In reduced coordinates (y,nΞΈ)(y,n\theta), the determinant is one and P=βˆ’CrP=-C_r. A parallel ray entering at unit height leaves at height A with reduced slope βˆ’P. It crosses the axis at the rear focal point:

BFD=nβ€²AP,fβ€²=nβ€²P\mathrm{BFD}=\frac{n^{\prime}A}{P},\qquad f^{\prime}=\frac{n^{\prime}}{P}

Extending the ray backwards to unit height locates the rear principal plane, a distance fβ€²f^{\prime} before the rear focal point. Running the argument backwards gives the front focal and principal planes. Rays aimed at the nodal point leave at the same angle:

Nβˆ’H=nβ€²βˆ’nPN-H=\frac{n^{\prime}-n}{P}

Nodal and principal points coincide when the input and output media have the same refractive index.

Exercise 1: imaging with a thin lens

  1. Load Single lens. With f = 100 mm and so = 300 mm, predict si and m from 1so+1si=1f\frac1{s_o}+\frac1{s_i}=\frac1f.
  2. Check that the construction rays and the exact fan meet at the detector. Then drag the object to 150 mm and to 100 mm.
  3. Record si and m for so = 300, 150, 100 and 50 mm.
  4. Explain why si changes sign as the object crosses F, and why the tool reports an angular size at so = f instead of a huge number.
Show answer

si = 150 mm, m = βˆ’0.5 (real, inverted). At 150 mm: si = 300 mm, m = βˆ’2. At 100 mm the matrix element d = 0, so the image is at infinity and each object point leaves as a parallel bundle with slope βˆ’h/f (βˆ’0.1 rad for h = 10 mm). At 50 mm: si = βˆ’100 mm, m = +2, a virtual upright image 100 mm in front of the lens. The rays diverge after the lens, and their dashed backward extensions meet at the virtual image.

Exercise 2: paraxial limit (limiting case)

  1. Load Thick BK7 lens. Predict how the exact axial crossing of a ray at height y differs from the paraxial focus as y β†’ 0.
  2. Read the "Exact vs paraxial" table and the longitudinal-aberration plot.
  3. Compute error/ρ² for ρ = 0.1, 0.05 and 0.01.
  4. Explain the limit in terms of sin u = u βˆ’ uΒ³/6 + …
Show answer

The error goes to zero, and error/ρ² tends to a constant, about βˆ’9.7 mm. At full aperture the error is βˆ’11.6 mm, larger in magnitude than the ρ² extrapolation, because fifth- and higher-order terms add to it. The paraxial model keeps only the first-order terms of Snell's law, so the leading correction to the focus is third order in angle. That appears as a ρ² shift of the axial crossing, which is primary (Seidel) spherical aberration. Marginal rays focus short of the paraxial focus, so a positive singlet is undercorrected.

Exercise 3: chromatic aberration and the achromat

  1. For a thin singlet, Ξ΄f/f β‰ˆ βˆ’Ξ΄n/(n βˆ’ 1) = 1/V. Predict the F–C focal spread of a 60 mm N-BK7 lens (V β‰ˆ 64).
  2. Turn on the F, d, C lines for Thick BK7 lens, then load BK7/F2 achromat.
  3. Read the horizontal gap between the blue and red curves at ρ β†’ 0 in the longitudinal plot for both systems.
  4. Why does a flint element of the opposite power sign fix the colour error, and what is left over?
Show answer

60/64 β‰ˆ 0.9 mm; the tool gives β‰ˆ 0.89 mm (F focuses closer). In the doublet the gap drops to β‰ˆ 0.15 mm, and the F and C curves cross in the aperture. The two elements satisfy Ο†1/V1 + Ο†2/V2 β‰ˆ 0, so their colour errors cancel while their powers do not. What remains is secondary spectrum (the d line focuses at a different place from F and C), zonal spherical aberration and spherochromatism.

Exercise 4: stops, pupils and the telescope eye relief

  1. In the Keplerian telescope (f1 = 200 mm, f2 = 50 mm) the objective is the aperture stop. Predict the exit-pupil position and diameter.
  2. Turn on stops and pupils and read the XP marker and readout.
  3. Record the angular magnification and the exit-pupil radius.
  4. Explain why the eye should be placed at XP, and why the Galilean telescope has no real exit pupil you can reach.
Show answer

The eyepiece images the objective from 250 mm in front of it, so the XP lies 1/(1/50 βˆ’ 1/250) = 62.5 mm behind the eyepiece. Its radius is 25 Γ— 62.5/250 = 6.25 mm (the beam is compressed by M = 4), and the angular magnification is βˆ’f1/f2 = βˆ’4. Every field angle's bundle passes through the XP, so a pupil placed there sees the whole field. In the Galilean design the objective's image through the negative eyepiece is virtual and lies inside the tube. The eye pupil therefore becomes the aperture stop, and the objective limits the field (vignetting).

Worked example: a thick lens with the matrix method

Take an equiconvex N-BK7 lens with R1 = +60 mm, R2 = βˆ’60 mm, t = 12 mm and nd = 1.5168 in air (preset Thick BK7 lens).

  1. Refraction at surface 1 gives C1 = (1 βˆ’ n)/(nR1) = βˆ’0.005679 mm⁻¹ with D1 = 1/n. Propagation is T(12). Surface 2 gives C2 = (n βˆ’ 1)/R2 = βˆ’0.008613 mm⁻¹ with D2 = n.
  2. Multiplying gives M=(0.93197.911βˆ’0.016640.9319)M=\begin{pmatrix}0.9319&7.911\\-0.01664&0.9319\end{pmatrix} (B in mm, C in mm⁻¹). The determinant is 1 because both media are air.
  3. P = βˆ’C = 0.01664 mm⁻¹, so f = fβ€² = 60.10 mm. BFD = A/P = 56.00 mm, so Fβ€² is 68.00 mm from the front vertex.
  4. Hβ€² = BFD βˆ’ fβ€² = βˆ’4.10 mm from the back vertex, and by symmetry H is 4.10 mm inside the front vertex. The principal planes sit inside the glass, and N = H, Nβ€² = Hβ€².
  5. For an object 300 mm in front of H, the Gaussian formula measured from the principal planes gives 1/300 + 1/sβ€² = 1/60.10, so sβ€² = 75.1 mm from Hβ€² (about 71 mm after the back vertex). Load the preset, untick "object at infinity" and set so = 295.9 mm to check it.

At full aperture (semi-diameter 20 mm) the exact marginal ray crosses the axis β‰ˆ 11.6 mm before Fβ€². That is far more than the depth of focus Ξ»/NAβ€²Β² β‰ˆ 6 Β΅m, so this lens is strongly aberration-limited at f/1.5. Stopping down to 5 mm cuts the spherical aberration by (20/5)Β² = 16.

When the model fails

  • Diffraction. Near focus, rays predict a point. The real spot is at least the Airy pattern 1.22 Ξ»/NAβ€², and ray optics ignores interference entirely (see Fourier optics and aperture propagation).
  • Paraxial matrices hold only while angles and heights are small. Their error grows as uΒ² (spherical aberration, coma, astigmatism and field curvature are all third-order effects).
  • Meridional drawing. Coma, astigmatism and field curvature involve skew rays. The bench shows only rays in the y–z plane, so the spot diagram and field curves run a separate 3D trace. The tool does not compute the full Seidel/wavefront decomposition, off-axis vignetting of skew rays at the pupil edge or tilted and decentred elements.
  • Sequential tracing ignores ghost reflections, stray light and rays that miss a surface and hit a later one. It also ignores Fresnel losses at each surface (β‰ˆ 4 % per air–glass surface, see thin films).
  • Ideal thin lens is a mathematical perfect imager and does not exist. Real lenses have thickness, curvature and dispersion.
  • Gaussian laser beams focus to a waist wβ‚€, not to the ray-optics point, and the waist is not at the geometrical focus in general (see Gaussian beams).

References

  • E. Hecht, Optics, 5th ed., Pearson (2017), ch. 5–6.
  • W. J. Smith, Modern Optical Engineering, 4th ed., McGraw-Hill (2008): stops, pupils, aberrations.
  • W. T. Welford, Aberrations of Optical Systems, Adam Hilger (1986): exact ray tracing, Coddington equations.
  • A. Gerrard and J. M. Burch, Introduction to Matrix Methods in Optics, Dover (1994).
  • SCHOTT optical glass data sheets, N-BK7 and F2 Sellmeier coefficients.
  • MIT OCW 2.71 Optics, lectures on geometrical optics and imaging.