Optics

Diffraction

Waves bending around obstacles or through slits — what makes light spread, not stay sharp

Diffraction is the bending of waves around edges or through openings. Most pronounced when wavelength is comparable to obstacle size. Light through a narrow slit creates a pattern of bright and dark bands. CD/DVD discs split light by diffraction. Limit of optical instrument resolution. Critical for understanding wave nature of light, electron microscopy, X-ray crystallography.

  • Single slit patternCentral max + decreasing side maxima
  • Single slit minimum ata·sin θ = m·λ (a = slit width)
  • Double slit patternBright bands at d·sin θ = m·λ (d = slit separation)
  • Diffraction gratingMany slits → very narrow bright lines
  • Rayleigh criterionResolvable if Δθ ≥ 1.22·λ/D (D = aperture)
  • Bragg's law2d·sin θ = n·λ (X-ray crystallography)

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

Diffraction basics

Diffraction is the bending of waves around edges or through openings. Most pronounced when:

  • Wavelength is comparable to feature size.
  • Wave hits a small aperture or sharp edge.

Single-slit diffraction

Light passes through a slit of width a. On a screen far away, intensity pattern has a bright central maximum, with weaker maxima alternating with minima at angles where:

a · sin θ = m · λ  (m = 1, 2, 3, ... = positions of dark minima)

Central maximum width is approximately 2λ/a (in angle from center). Smaller slit → wider diffraction pattern.

Double-slit diffraction

Two slits separated by d. Light from both slits interferes:

d · sin θ = m · λ  (constructive — bright fringes)

Pattern: equally-spaced bright fringes (from interference), modulated by single-slit envelope (from diffraction). Foundation of Young's experiment showing light's wave nature.

Diffraction grating

Many parallel slits, separation d. Same equation as double-slit, but with many slits, fringes are MUCH sharper:

d · sin θ = m · λ

Used in spectrometers — different wavelengths diffract at different angles. CDs/DVDs (regularly spaced tracks) act as gratings — that's the rainbow on their surface.

Resolution and Rayleigh criterion

An aperture of diameter D produces a diffraction-limited image. The smallest angular separation it can resolve:

Δθ_min = 1.22 · λ / D  (Rayleigh criterion, circular aperture)
InstrumentDλΔθ_min
Human eye (pupil 5 mm)5 mm500 nm~25 arcsec
Hubble Space Telescope2.4 m500 nm~0.05 arcsec
James Webb Space Telescope6.5 m2 µm (IR)~0.07 arcsec
Very Large Telescope (VLT)8.2 m500 nm~0.015 arcsec
VLBI (radio interferometry)~thousands km~cm~µas

JavaScript — diffraction calculations

// Single-slit minimum positions
function singleSlitMinima(slitWidth, wavelength, m_max = 5) {
  return Array.from({length: m_max}, (_, i) => {
    const m = i + 1;
    const angle = Math.asin(m * wavelength / slitWidth);
    return { m, angleRadians: angle, angleDegrees: angle * 180/Math.PI };
  });
}

// 0.1 mm slit, 633 nm laser
console.log(singleSlitMinima(1e-4, 633e-9, 3));

// Double-slit fringe spacing
function fringeSpacing(slitSeparation, wavelength, screenDistance) {
  // Δy = λ·L/d
  return wavelength * screenDistance / slitSeparation;
}

console.log(`Double slit: ${fringeSpacing(0.5e-3, 633e-9, 1) * 1000} mm fringes`);  // 1.27 mm

// Grating: angles of bright fringes
function gratingMaxima(d, wavelength, max_orders = 3) {
  const orders = [];
  for (let m = 0; m <= max_orders; m++) {
    const sin_theta = m * wavelength / d;
    if (Math.abs(sin_theta) <= 1) {
      orders.push({ m, angleDeg: Math.asin(sin_theta) * 180/Math.PI });
    }
  }
  return orders;
}

// Diffraction grating with 600 lines/mm = d = 1.67e-6 m, 633 nm light
console.log(gratingMaxima(1/600 * 1e-3, 633e-9));

// Rayleigh resolution
function rayleighResolution(diameter, wavelength) {
  return 1.22 * wavelength / diameter * 180/Math.PI * 3600;  // arcseconds
}

console.log(`Hubble at 500 nm: ${rayleighResolution(2.4, 500e-9).toFixed(3)} arcsec`);
console.log(`Webb at 2 µm: ${rayleighResolution(6.5, 2e-6).toFixed(3)} arcsec`);

// Bragg's law for X-ray diffraction
function braggAngle(latticeSpacing, wavelength, order = 1) {
  // 2d·sin θ = n·λ
  const sin_theta = order * wavelength / (2 * latticeSpacing);
  if (Math.abs(sin_theta) > 1) return null;
  return Math.asin(sin_theta) * 180/Math.PI;
}

// X-ray (1.54 Å, copper Kα), NaCl crystal (d = 2.82 Å)
console.log(`NaCl X-ray Bragg angle: ${braggAngle(2.82e-10, 1.54e-10).toFixed(2)}°`);

// Sound diffraction around a building
function soundDiffractionAngle(wavelength, building_width) {
  // Rough rule: significant diffraction when λ > building_width/3
  return wavelength > building_width / 3
    ? 'significant'
    : 'minimal';
}

// 100 Hz bass (λ ≈ 3.4 m) around a 10 m wide building
console.log(soundDiffractionAngle(3.4, 10));  // 'significant' — bass bends well
// 1000 Hz (λ ≈ 0.34 m) around same building
console.log(soundDiffractionAngle(0.34, 10));  // 'minimal' — high freq goes mostly straight

Where diffraction matters

  • Astronomy. Telescope resolution limited by diffraction. Spectroscopy uses gratings.
  • Microscopy. Diffraction limit for optical microscopy ~ λ/2 ~ 200 nm. Electron microscopy uses much shorter wavelengths.
  • X-ray crystallography. Diffraction patterns reveal atomic structures. DNA, proteins, materials.
  • Photography. Lens diffraction limits sharpness at small apertures (high f-numbers).
  • Acoustics. Sound bending around buildings, in concert halls (good for live sound!).
  • Antennas. Pattern of broadcast depends on diffraction; large dishes have narrow beams.
  • Lasers. Diffraction of laser through aperture defines beam divergence.

Common mistakes

  • Confusing diffraction with refraction. Refraction is angle change at boundary (Snell). Diffraction is bending around edges/aperture.
  • Treating wave optics as ray optics for small apertures. Geometrical (ray) optics fails when wavelength approaches feature size. Need wave optics for slits, edges, small apertures.
  • Wrong slit-width formula. Single-slit minima at a·sin θ = m·λ. Double-slit MAXIMA at d·sin θ = m·λ. Different formulas for similar setups.
  • Forgetting grating order limits. Higher orders may exceed sin θ = 1 → no diffracted ray. Limited orders for given λ/d ratio.
  • Ignoring polarization in some configurations. Some gratings polarization-dependent. For very precise spectroscopy, account for it.
  • Treating Rayleigh as a hard limit. Beyond it, you can sometimes still resolve via deconvolution, super-resolution methods. But it's a useful rule of thumb.

Frequently asked questions

Why do waves diffract?

Huygens' principle — every point on a wavefront acts as a new source of spherical wavelets. When a wave passes through an aperture, only some of these wavelets propagate forward, creating a "spread" pattern. For a wide opening, diffraction is small; for a narrow one (size ~ λ), diffraction is dramatic. Same idea applies to obstacles — wave diffracts around them.

When is diffraction noticeable?

When wavelength is comparable to feature size. Visible light (λ ~ 500 nm) diffracts at slits or holes ~ µm to mm size. Sound (λ ~ 1 m) diffracts around walls and around corners — that's why you can hear someone around a corner. Radio (λ ~ m) diffracts around buildings and hills.

How does the double-slit experiment work?

Two narrow slits, distance d apart. Light passing through both interferes. Bright fringes where path difference is integer wavelengths (constructive). Dark fringes where it's half-integer (destructive). Fringe positions: y = m·λ·L/d, where L is screen distance. Iconic experiment showed light is wave (Young, 1801) and later that electrons also diffract (matter waves).

What's a diffraction grating?

A surface with many regularly spaced slits or grooves. Each slit diffracts; light from many slits interferes. Result — sharp, well-separated bright maxima. Grating equation: d·sin θ = m·λ. Used in spectrometers (separate wavelengths), CDs/DVDs (act as gratings), monochromators in lab. Higher slit density → wider angular separation.

How does diffraction limit telescopes?

Rayleigh criterion: minimum resolvable angle is ~1.22·λ/D, where D is aperture diameter. Larger telescopes resolve finer details. Hubble (D = 2.4 m, λ ~ 500 nm): minimum angle ≈ 0.05 arcsec. Larger telescopes (Webb 6.5m) resolve finer. Adaptive optics counters atmospheric turbulence; interferometry combines telescopes for even finer resolution.

What's X-ray diffraction?

X-rays (λ ~ 0.1 nm) interact with crystal lattice (atomic spacing ~0.1 nm). Bragg's law: 2d·sin θ = n·λ predicts diffraction maxima. By measuring angles, one can determine crystal structure. How DNA's double helix was discovered (Rosalind Franklin's images), how protein structures are solved, how materials are characterized.

Can sound waves diffract?

Yes, very effectively because of long wavelengths. Behind a building, you can hear sound but not see (light's λ is too short). Sound bends around corners, through windows. Audio engineering accounts for diffraction at edges of speakers. Antennas use diffraction to broadcast over the horizon.