← 🔬 Optics
🔬 Optics • Difficulty ★★★

2D Diffraction — Fraunhofer Slit Pattern by Wavelet Integration

Each slit is discretized into hundreds of Huygens point sources across its aperture. The far-field screen intensity at every angle is a genuine coherent phasor sum over all of them — a real numerical diffraction integral, not the sinc formula alone — plotted live against the closed-form curve for a direct convergence check.

🔬 Aperture Controls

Wavelength λ: —
1st minimum (envelope) y: —
Fringe spacing Δy ≈ λL/d: —
Aperture points used: —
RMS error vs analytic sinc: —

A Real Numerical Diffraction Integral

Each slit is discretized into up to 400 equally-weighted Huygens point sources spanning its width. For every screen angle, the simulation coherently sums eikx sinθ over all of them to build the far-field amplitude, then squares its magnitude — the discretized Fraunhofer integral, computed the same way a numerical physics solver would, not read off a formula.

Cross-Checked Against the Closed Form

The dashed curve is the textbook prediction: sinc²(πa sinθ/λ) for one slit, times cos²(πd sinθ/λ) for two. Drag the integration-points slider down and the solid numerical curve visibly departs from it; drag it up and the RMS-error readout shrinks toward zero — direct, on-screen proof the pattern is being built from summed wavelets, not evaluated analytically.

Exact Geometry, Not Small-Angle

sinθ = y/√(y²+L²) is computed exactly from the screen position and distance L, so the pattern stays correct even at wide diffraction angles where the small-angle approximation used by simpler simulators breaks down.

About 2D Diffraction

This simulation performs a genuine numerical Fraunhofer diffraction integral. A single or double slit is discretized into up to 400 equally-spaced point sources across its aperture. For every point along the screen line, the exact angle sinθ = y/√(y²+L²) is computed, and the far-field amplitude is built by coherently summing eikx sinθ from every one of those point sources — the discretized form of the Huygens-Fresnel integral E(θ) = ∫ eikx sinθ dx. Squaring that sum's magnitude gives the intensity pattern you see as the solid curve.

A dashed curve overlays the closed-form prediction — sinc²(πa sinθ/λ) for a single slit, multiplied by cos²(πd sinθ/λ) for two coherent slits — so you can watch the numerical sum converge onto the textbook formula as the integration-point count grows, or watch it visibly break down when you drag that count down to just a handful of sources.

Frequently Asked Questions

How is this different from a simple point-source interference simulation?

A basic interference demo places a handful of fixed point sources and sums their near-field waves. Here, each slit's full aperture is discretized into up to 400 sources to numerically evaluate the actual far-field diffraction integral at every screen angle — the same computation a numerical optics solver performs, cross-checked live against the closed-form sinc-squared formula.

What does the integration-points slider actually change?

It sets how many discrete point sources represent each slit's continuous aperture. At low values (a handful of points) the summed pattern visibly diverges from smooth diffraction theory — you can see aliasing-like artifacts appear at wide angles. At high values it converges tightly onto the analytic sinc² prediction, which the RMS-error readout quantifies directly.

Why use sinθ = y/√(y²+L²) instead of the small-angle approximation?

Using the exact geometric sine keeps the pattern correct even when the screen distance L is comparable to the pattern width, where the small-angle approximation sinθ ≈ θ used by simpler simulators starts to distort peak positions.

What is the Huygens-Fresnel principle?

It states that every point on a wavefront (or, here, every point across an open aperture) acts as a source of a new spherical/circular wavelet. The observed field anywhere beyond the aperture is the coherent sum of all those wavelets. This simulation implements that literally: each aperture point is a genuine phasor source summed at every screen angle.

What is the Fraunhofer (far-field) diffraction integral?

It is the limit of the Huygens-Fresnel sum when the screen is far enough that arriving wavefronts are effectively planar, so each source's phase contribution reduces to k·x·sinθ. Discretizing the aperture into point sources and summing exp(ikx sinθ) — as this simulation does — is the direct numerical evaluation of that integral.

Why does the double-slit pattern have both fine fringes and a broad envelope?

The two-slit interference term cos²(πd sinθ/λ) produces closely spaced bright/dark fringes set by the separation d, while each slit's own diffraction envelope sinc²(πa sinθ/λ) modulates their brightness, fading the outer fringes. Because both slits are discretized and summed together, the numerical curve reproduces this product automatically without it being coded in explicitly.

Is the closed-form sinc formula wrong, then?

No — it is the exact analytic solution of the same integral this simulation evaluates numerically. The point of showing both is pedagogical: the dashed curve proves what the numerically-summed wavelets should converge to, and the convergence you can watch happen (by raising the point count) is direct evidence the physics is being computed, not looked up.

What real instruments rely on this diffraction integral?

Spectrometers and diffraction gratings use exactly this physics — extended many-slit versions of the double-slit case — to separate wavelengths. The same Fraunhofer mathematics also sets the diffraction-limited resolution of telescopes and microscopes and underlies X-ray crystallography.