Diffraction Grating Calculator Formula

Understand the math behind the diffraction grating calculator. Each variable explained with a worked example.

Formulas Used

Diffraction Angle

angle = asin(order * wavelength / slit_spacing) * 180 / pi

Variables

VariableDescriptionDefault
slit_spacingSlit Spacing (d)(nm)1667
orderDiffraction Order (m)1
wavelengthWavelength(nm)550

How It Works

Diffraction Grating

A diffraction grating splits light into its component wavelengths at specific angles.

Formula

d * sin(theta) = m * lambda

where d is the slit spacing, m is the diffraction order (1, 2, 3, ...), and lambda is the wavelength. The slit spacing d = 1/(lines per unit length).

Worked Example

First-order diffraction of 550 nm light through a 600 lines/mm grating (d = 1667 nm).

slit_spacing = 1667order = 1wavelength = 550
  1. 01d * sin(theta) = m * lambda
  2. 021667 * sin(theta) = 1 * 550
  3. 03sin(theta) = 550/1667 = 0.3299
  4. 04theta = 19.26°

Frequently Asked Questions

What is a diffraction grating?

An optical element with many closely spaced parallel slits or grooves. It separates light by wavelength through constructive interference at specific angles.

How many orders of diffraction are possible?

The maximum order is when sin(theta) = 1, giving m_max = d/lambda (rounded down). Higher orders are at larger angles.

What is the advantage over a prism?

Gratings provide higher resolution and more uniform dispersion across wavelengths compared to prisms.

Ready to run the numbers?

Open Diffraction Grating Calculator