In geometric optics, Fermat’s principle is a foundational idea that states that light going from point A to point B traverses the route that has a stationary optical path length (OPL). The OPL is given by:
The rightmost equality only holds in a homogeneous medium. Fermat’s principle also implies the principle of reversibility, i.e., for a route from A to B, if we reversed the path such that A was the source, it would take the same path.
Usually the path with stationary OPL is a minimum (hence we try to minimise). But in practice, it can also be an inflection point or maximum. If there are more than one stationary paths, then light can take more than one route to go from A to B.
Calculations
In our calculations, we take the first derivative of the OPL (mainly of ) and set it to 0. We keep the resulting expression. The term is usually kept as a constant, so the derivative is of the term.
For a simple 2-media boundary, the resulting equation is given by:
where we differentiate the lengths with respect to the angles.