PPolySim OS

Diffraction Grating

Add more slits and the bright fringes get sharper and brighter. This is how a diffraction grating splits light into precise, well-separated spectral lines.

Diffraction GratingLive

Controls

More slits make the bright maxima sharper and brighter — the principle behind spectrometers that split light into precise spectral lines.

Presets

▶ Run in Python

Data Inspector

Slits5
Resolution∝ N
Maxima atd·sinθ = mλ

Governing equation

Reading this result: The bright maxima stay locked where d·sinθ = mλ — fixed by spacing and wavelength, not slit count — but with 5 slits each principal peak is about 5× narrower and far more intense, which is how a grating resolves fine spectral lines.

Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.

or unlock everything with Pro →
★ Sign in to save this setup
Save your tuned setup, or drop this simulation into your own site, docs, or course page.

How it works

An N-slit grating produces intensity maxima where d·sinθ = mλ, and the peaks narrow as the number of slits grows (resolution ∝ N). Gratings are the heart of spectrometers used across chemistry, astronomy, and materials analysis.

✦

Ask the AI about this model

The math, the assumptions, real-world uses, or a code translation — explained for this exact simulation.

More Optics simulations

Frequently asked questions

Is this diffraction grating tool really free?▾
Yes. Diffraction Grating runs entirely in your browser using your device's own compute, so local use is free forever. You only pay Compute Tokens if you scale a job to the cloud.
Do I need to install anything?▾
No. Everything runs client-side in a modern browser — no downloads, no license, no account required to start.
Can I save or share my simulation?▾
Create a free account to save projects, and use a shareable embed or minted DOI to publish a live, interactive version anywhere.
How accurate are the results?▾
The solver uses established numerical methods, but results are for research and educational purposes and should be validated against experiment or professional review before you rely on them.