Using Fermat's principle derive the laws of deflection and refraction of light on the plane interface between two media.