Calculating wavelength and frequency of light