Wiki / Dispersive elements / Diffraction grating

Diffraction grating

Separates light into selected diffraction orders using the grating equation, with adjustable groove density, order efficiency, and a choice of spectral illumination.

Open in the canvas →

A live trace, not a picture of one — but this preview is not interactive. Open it in the canvas to move things, change parameters, and save or export your own version.

In the real world

A diffraction grating is a surface ruled with closely, evenly spaced lines (period d). Light diffracting from it interferes constructively only at angles satisfying the grating equation:

d (sin⁡θi+sin⁡θm)=mλd\,(\sin\theta_i + \sin\theta_m) = m\lambda
The grating equation: incidence angle θᵢ, diffraction angle θₘ, integer order m, line spacing d.

Because the equation depends on λ, each nonzero order spreads white light into a spectrum — the same effect a prism produces through dispersion, but from interference rather than refractive-index variation.

In OpticalSetup

This is one of the few components where OpticalSetup implements the textbook formula directly and exactly, solving the grating equation per sampled wavelength for every configured diffraction order, in either reflective or transmissive mode. Orders where the equation has no real solution (|sinθₘ| > 1) are simply dropped, matching a real grating's behavior of only lighting up the orders that geometrically exist. Their light is not dropped with them: it goes to the orders that do exist, as it does on a real grating when an order passes off. A 2400 lines/mm grating at 532 nm has nowhere to send the beam but the zeroth order, and sends all of it there.

Simplified vs. reality

Diffraction efficiency is split evenly across the configured orders that propagate, rather than computed from the groove profile (a real blazed grating concentrates most of the light into one order by design) — order existence and angle are exact, relative brightness between orders is not. Since which orders propagate depends on wavelength, a broadband beam whose orders pass off inside its band divides its power differently at each end of the band.

Related components

Further reading