A diffraction grating consists of a set of many evenly spaced slits, in which the slit separation is very small. (See: Young's Slits) This means the principal maxima are very narrow, and there are so many subsidiary maxima that they are so faint as to be effectively invisible.
A beam of monochromatic light passing through a diffraction grating is split into very narrow maxima.
Each slit in a grating diffracts the incident light, and the diffracted waves interfere constructively in certain directions only.
The relationship between the angle at which the maxima occur, the slit separation, and the wavelength of light is as follows:
sin(x) = (n(lamda)) / d
Where:
x is the angle offset of the maxima,
(lambda) is the wavelength of the light,
n is the order of the maximum; and
d is the slit separation.
This formula may be used with a manufactured diffraction grating to determine the approximate wavelength of any incident monochromatic light.