The grating equation gives the calculation of diffraction angles (which are the same for transmissive (as in the picture) or reflective gratings. CalcTool allows you to enter grating density in standard units, or as a period.
Diffraction gratings are common in science and engineering, and can be seen in products such as optical discs. They also appear in nature to produce irridescent colors, for example in mother-of-pearl, peacock feathers, and butterfly wings.