Parameters
lam : wavelength
i : angle of incidence
d : grating pitch
k : diffraction order
D : incident wave size in the direction perpendicular to the diffraction lines
did : divergence of the diffracted wave in the direction perpendicular to the diffraction lines
Res : theoretical resolvance of the grating