From Tabachnikov's book:
Classical mechanics and geometrical optics, discussed in this chapter, are intimately related. The configuration trajectories of mechanical systems are extremals of a variational principle, similar to the trajectories of light. In fact, mechanics can be described as akind of geometrical optics; this was Hamilton’s approach to mechanics(see [3] for details). The brachistochrone problem is a good example of this optics-mechanics analogy.