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 points against the incoming ray.
Refracted direction
Here and . If the square root is not real, total internal reflection occurs.
Reflected direction
The ideal thin lens changes the ray slope by 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 and slope 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:
Propagation through distance t
Refraction from n to nβ²
Mirror
Thin lens with focal length f
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:
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:
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
- Axial position and meridional ray height. The screen uses millimetres; calculations use metres. Incoming light travels in the positive z direction.
- Surface radius of curvature. R is positive when the centre of curvature lies to the right of the surface vertex.
- 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.
- Refractive indices in the input and output spaces.
- System power and front/rear focal lengths. Using the reduced ray vector , , and . The effective focal length is .
- Focal, principal and nodal points. Principal planes have unit transverse magnification; nodal points have unit angular magnification. Their displacement obeys .
- Entrance and exit pupils: the images of the aperture stop seen from object space and image space.
- Image-side numerical aperture: for the paraxial marginal ray that just fills the aperture stop.
- Vacuum wavelength. The N-BK7 and F2 glass indices use the Sellmeier equation: .
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 :
Propagating a further distance makes the top-right entry . All rays from one object point reach the same image height when this entry vanishes:
For a thin lens, and . Substitution gives the familiar lens equation:
As , the image goes to infinity. Each ray from the object top then leaves with the same slope , which the tool reports.
In reduced coordinates , the determinant is one and . A parallel ray entering at unit height leaves at height A with reduced slope βP. It crosses the axis at the rear focal point:
Extending the ray backwards to unit height locates the rear principal plane, a distance 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:
Nodal and principal points coincide when the input and output media have the same refractive index.
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).
- 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.
- Multiplying gives (B in mm, C in mmβ»ΒΉ). The determinant is 1 because both media are air.
- 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.
- 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β².
- 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.