Grating is an optical component of a device which will split and diffract light into beams to move in different directions. The direction of light depends on the spacing of the grating and the wavelength of the light. Grating acts as the dispersive element. They are often used in cameras.
The relationship between grating spacing and the angles of incident and diffracted beams of light is known as the grating equation. Huygens-Fresenal principle states that each point on the wave front of a propagating wave can be considered to act as a point source. The wave front at any subsequent point can be found by adding together the contributions from each of these individual point sources.