how to calculate the length of light