Grating Theory
The Grating feature releases secondary rays of arbitrary diffraction order. The angles at which transmitted and reflected diffraction orders are released are those at which the waves generated by successive unit cells interfere constructively with each other. A transmitted wave of diffraction order m corresponds to an angle θm with the boundary normal so that
where λ0 is the vacuum wavelength, d is the grating constant, θi is the angle of incidence, and n1 and n2 are the refractive indices on the incoming and outgoing sides of the boundary, respectively. The corresponding relation for the reflected wave is