# Diffraction & Interference Simulator - Single/Double Slit, Grating, Airy Disk, Thin Film Colors, Malus's Law

> Free wave-optics simulator: slit and grating patterns in white light, Airy disks and the Rayleigh limit, thin-film colours, Newton's rings and Malus's law.

- URL: https://qilingtools.com/en/math/diffraction
- Category: Physics Tools (https://qilingtools.com/en/physics)
- Tags: [Physics](https://qilingtools.com/en/tags/physics), [Education](https://qilingtools.com/en/tags/education)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

A wave-optics bench that runs in your browser, in four parts. Slits and gratings: set the wavelength, slit width a, separation d, number of slits N and screen distance L to see the exact intensity I(θ) = I₀[sinβ/β]²[sinNγ/(N sinγ)]² and the pattern on the screen, with minima, bright orders and missing orders marked; white-light mode sums every wavelength through the D65 spectrum and CIE colour-matching functions to show the real coloured fringes. Circular apertures: two point sources imaged as Airy disks [2J₁(x)/x]², with a slider to watch them become just resolved, and Rayleigh limits for the eye, a phone camera, binoculars or the Hubble telescope. Thin films use the exact multiple-reflection formula to give reflectance spectra and colours for soap bubbles, oil slicks, MgF₂ coatings, wedges and Newton's rings. The polarizer bench lets you drag up to four polarizers to check Malus's law and the three-polarizer paradox.

## How to use

1. Pick a module: slits and gratings, circular aperture, thin films or polarizers
2. Choose a preset or move the sliders for wavelength, slit width, separation, aperture, film thickness, refractive index or polarizer angle
3. Read the screen pattern, intensity curve, Airy image, reflected colour or transmitted intensity, along with minima positions, resolution limits, reflectance and the formulas used

## Features

- Exact intensity curves and screen patterns for single, double and N-slit gratings, with missing orders flagged
- White-light mode that sums 380–730 nm into true-colour fringes and grating spectra
- 2D Airy pattern and profile, the 73.5% Rayleigh dip and resolution presets from the eye to the Keck telescope
- Thin-film reflectance from the multi-beam formula averaged over s and p, with a colour-vs-thickness strip, wedge film and Newton's rings
- Draggable polarizers with the Malus curve and the intensity after each one
- Everything is computed locally; nothing is uploaded

## FAQ

### How do I calculate double-slit fringe spacing, and why do some bright fringes disappear?

For small angles the spacing between bright fringes is Δy ≈ λL/d, so a 632.8 nm laser with d = 0.25 mm and L = 1 m gives about 2.53 mm. The real pattern is the two-slit term multiplied by the single-slit envelope [sinβ/β]². When a bright order d sinθ = mλ lands exactly on an envelope minimum a sinθ = kλ, i.e. when m·a/d is a whole number, that order is missing. With d = 5a the ±5th and ±10th orders vanish.

### What is the Rayleigh criterion, and how small an angle can the eye or a telescope resolve?

A circular aperture images a point as an Airy disk whose central spot has angular radius θ = 1.22λ/D. Two points are just resolved when the centre of one disk falls on the first dark ring of the other; the intensity between them then dips to about 73.5% of the peak. At 550 nm a 3 mm pupil gives about 46″ (the retina limits the eye to roughly 1′ in practice), and Hubble's 2.4 m mirror about 0.058″, enough to separate features about 100 m apart on the Moon.

### Why are soap bubbles colourful, and why do they turn black just before popping?

Light reflected from the front and back of the film interferes. The path difference is 2nd cosθ, plus a half-wave phase shift at the front surface, so some wavelengths reinforce and others cancel, and the reflected light is coloured; the colours cycle as the thickness changes. When the film becomes much thinner than the wavelength (below about 30 nm) the two reflections differ by almost exactly half a wave and cancel, so the top of a draining bubble looks black. Very thick films overlap many orders and look white again.

### Why is an anti-reflection coating a quarter wavelength thick?

On glass with n = 1.52, a MgF₂ layer with n ≈ 1.38 gives a half-wave shift at both surfaces, which cancel. The two reflections then interfere destructively when the round trip 2nd equals λ/2, i.e. nd = λ/4. Designed for 550 nm this means d ≈ 99.6 nm, and the reflectance falls from 4.3% for bare glass to about 1.3%; an ideal coating with n = √1.52 ≈ 1.23 would reach zero. Because the cancellation is complete only at the design wavelength, coated lenses often look faintly purple.

### How can adding a third polarizer between two crossed ones let light through?

Malus's law says polarized light passing a polarizer at angle θ keeps I cos²θ. Unpolarized light leaves the first polarizer (0°) with I₀/2; meeting a 90° polarizer next gives cos²90° = 0, total darkness. A 45° polarizer in between first projects the light onto 45° (I₀/4) and the last one projects it onto 90° (I₀/8). The middle polarizer changes the polarization direction, so polarizers project rather than filter; with more polarizers in smaller steps the output approaches I₀/2.

## Related tools

- [Unit Converter](https://qilingtools.com/en/math/unit): Free online unit converter: length, area, volume, weight, temperature, time, speed, data, pressure, energy and angle — one value converts every unit at once.
- [Vector Calculator](https://qilingtools.com/en/math/vector): Free online vector calculator for 2D and 3D: addition, scalar multiples, dot and cross products, magnitude, angle, unit vector and projections, with checks.
- [Significant Figures Calculator](https://qilingtools.com/en/math/significant-figures): Free online sig fig calculator: count significant figures digit by digit, round to N sig figs or decimals with six rounding modes, and compute by sig fig rules.
- [Tone Generator](https://qilingtools.com/en/audio/tone-generator): Free online tone generator: sine, square, sawtooth and triangle waves from 1 to 20,000 Hz, a note picker, sweeps, white/pink/brown noise and a WAV download.
- [Audio Spectrogram](https://qilingtools.com/en/audio/spectrogram): Free online spectrogram generator: see time, frequency and level from a Hann-windowed STFT, with FFT size, log axis, dB range and colour maps. Exports PNG.
- [Decibel Meter](https://qilingtools.com/en/audio/decibel): Free online decibel meter: measure noise with your mic in real time, A/C/Z weighting, fast/slow response, min/max/average/Leq, 60-second graph and calibration.
- [Physics Formula Calculator](https://qilingtools.com/en/math/physics): Physics formulas solved with steps: SUVAT, projectiles, Newton’s laws, inclines, energy, Ohm’s law, resistors, RC, buoyancy, waves, lenses, gravity.
- [Fourier Series & FFT Visualizer](https://qilingtools.com/en/math/fourier): Fourier series coefficients and animated partial sums for square, sawtooth, triangle or any function (Gibbs), draw-your-own epicycles and FFT spectra.
