Fermat's principle

Frae Wikipedia
Lowp tae: navigation, rake
Fermat's principle leads tae Snell's law; when the sines o the angles in the different media are in the same proportion as the propagation velocities, the time tae get frae P to Q is minimised.

In optics, Fermat's principle or the principle o least time is the principle that the path taken atween twa pynts bi a ray o licht is the path that can be traversed in the least time.