In optics, a iffraction grating is an optical component with a regular pattern, which splits light into several beams travelling in different directions. The directions of these beams depend on the spacing of the grating and the wavelength of the light so that the grating acts as a dispersive element. Because of this, gratings are commonly used in monochromators and spectrometers.