Documentation

Understanding light

Waves & diffraction

Rays are a convenient fiction. Send light through something small enough and it stops behaving like a ray and starts behaving like what it is: a wave.

Interference

Two waves arriving at the same place add. If crests line up with crests, you get a bright spot; if crests meet troughs, they cancel into darkness. Photonica computes this properly by summing Huygens wavelets from every point across an aperture, rather than tracing rays.

The double slit

Light through two narrow slits produces evenly spaced bright and dark fringes on a screen:

fringe spacing = λ · L / dλ is the wavelength, L the distance to the screen, d the spacing between slits. Wider spacing gives finer fringes.

To see it: add a Slit mask, then turn on wave mode for the screen in the Waves panel ("Screen 1 shows the diffraction pattern"). Rays alone will never show you fringes — the screen has to be computed as a coherent sum, which is exactly what that switch does.

Interference fringes from a double slit on a Photonica screen
Demo 11: Young's double slit. The fringes are a Huygens–Fresnel sum, not a texture.

Diffraction gratings

Thousands of slits instead of two, and the pattern sharpens into distinct beams called orders, each sending a different wavelength a different way:

m · λ = d · ( sin θin + sin θm )d is the spacing between lines (1/600 mm for a 600 lines/mm grating), m the order. This is how a spectrometer separates colours far more sharply than a prism can.

Photonica's grating is a sinusoidal phase grating: order m carries a fraction Jm(depth)² of the light, and a phase depth of 1.84 radians is the setting that maximises the ±1 orders. Set which order the main measured path follows with Measured order.

The diffraction limit

Even a flawless lens cannot focus light to a true point. The aperture itself diffracts, spreading the focus into an Airy disc whose radius is:

r ≈ 1.22 · λ · f / DD is the aperture diameter. This is the hard limit that decides how much detail a telescope or a microscope can ever resolve — no amount of polishing gets past it.

In the Waves panel, Compute PSF at best focus works out the real point spread function of your system and reports:

  • Strehl ratio — the peak brightness compared to a perfect lens. Above 0.8 the system counts as diffraction-limited (the Maréchal criterion); below that, aberrations dominate.
  • MTF — how much contrast survives at each level of fine detail, the standard way lens sharpness is specified.