The following is a markdown transcription of https://www.mathpages.com/rr/s8-04/8-04.htm
The interesting part are up to and including the paragraph that ends in "These are the equations of motion for light based on the temporal metric approach.". Can you reproduce these in the response, and then add a 3D version as well?
For now we see through a glass, darkly; but then face to face. Now I know in part, but then shall I know even as also I am known. — I Corinthians 13,12
We saw in Section 3.4 that Fermat's Principle of least time predicts that paths of light rays passing through a plane boundary between regions of constant refractive index, but to more fully appreciate this principle it's useful to develop the equations of motion for light rays in a medium with arbitrarily varying refractive index. First, notice that Snell's law enables us to determine the paths of optical rays passing though a discrete boundary between regions of constant refractive index, b