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:
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.

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:
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:
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.