A Detailed Theoretical Study of the Anomalies of a Sinusoidal Diffraction Grating