By analytical mechanics and optical Lagrangian:
(1) Calculate generally the optical path of a light beam in a medium of refractive index η.
(2) Show that the optical path is a straight line in a medium of constant refractive index, η = constant.
(3) Calculate the optical path in the atmosphere above a flat, sandy and very hot desert, where the refractive index depends on the altitude y above ground and can be represented by the relation η = ηo(1 - ay), with a constant characteristic of the medium and whose unit is the inverse of a distance.
(4) Deduce the distance between an observer lost in the desert and an oasis he sees from an angle arctan(1-2).