This applet simulates the passing of light through a set of slits (or lines) ranging from a single slit up to many slits forming a diffraction grating.
The displays show the image as would be seen on a screen 1000 mm from the grating, and a plot of the intensity as a function of position.
Scrollbars allow the number, width and spacing of the slits to be varied.
The simulation allows two separate wavelengths to be passed through the slits simultaneously - to use only one wavelength set both inputs to the same value. The controls allow the wavelength to be scanned up or down. This can be achieved in coarse or fine steps.