The Grating Equations

As shown in Fig.2.1 and Fig.2.2,α is the angle between the incident light and the normal to the grating (the incident angle) and ß is the angle between the diffracted light and the normal to the grating (the diffraction angle), then, they satisfy the following relationship:
as shown in Fig.2.1, in case of transmission grating

as shown in Fig.2.2 in case of a reflection grating,

d : Spacing between the slits (the grating period)
N : Number of slits per mm (the groove density, equal to the reciprocal of the grating period) 
m : Order of diffraction (m = 0, ± 1, ± 2,...) 
λ : Wavelength

It can be seen from this relationship that all components of light corresponding to m = 0 (zero-order light) are radiated in a straight line and so it is not possible to separate the wavelengths with this order. It can also be seen that for m ≠ 0 the diffraction angle ß is different for each wavelength. This is why gratings can be used to separate white light into its constituent wavelengths. The diffraction angle ß also varies with the groove density N and the incident angle α. One point requiring consideration is that, depending on the groove density N, it may not be possible to obtain diffracted light. For example, if the incident angle α = 30° and the groove density N = 2400 grooves/mm, applying the equation to first-order light (i.e., m = +1) with a wavelength λ of 700nm gives sin ß = 1.18, then diffracted light cannot be obtained in this case.