# Equations of Fermat's principle/Snell's law in a gradient lens (sugar aquarium)

I'm trying to animate a beam of light inside a substance with gradient index of refraction as a function of y. A good example of that is a syrup inside an aquarium like here https://www.youtube.com/watch?v=BV3aRiL64Ak What equations will i need if i also want to animate the beam released from different angle than pi/2 to the aquarium?

HINT :

In the Figure we see the path of least time of a particle from point $$\:\mathrm{A}_{0}\:$$ to point $$\:\mathrm{A}_{4}\:$$ through 4 regions of variable speed, increasing towards positive $$\:y$$. This would be the light path with decreasing refraction index. Every intermediate path $$\:\mathrm{A}_{j}\mathrm{A}_{j+2}\,(j=0,1,2)\:$$ is a path of least time between points $$\:\mathrm{A}_{j}\:$$ and $$\:\mathrm{A}_{j+2}\:$$. So by Snell's Law(1) $$$$\dfrac{v_{1}}{\sin\theta_1}=\dfrac{v_{2}}{\sin\theta_2}=\dfrac{v_{3}}{\sin\theta_3}=\dfrac{v_{4}}{\sin\theta_4}=\textrm{constant} \tag{01}$$$$

Now, if instead of the discrete regions we have a continuum with speed $$\:v(y)\:$$ being a continuous smooth increasing function of $$\:y\:$$, then in place of the piece-wise rectilinear path we would have a continuous smooth curve and $$$$\dfrac{v(y)}{\sin[\theta(y)]}=v(y)\sqrt{1+\cot^{2}\theta}=v(y)\sqrt{1+\left(\dfrac{\mathrm{d} y}{\mathrm{d} x}\right)^{2}}=v(y)\sqrt{1+y'^{\,2}}=C_{1}=\textrm{constant} \tag{02}$$$$

Now $$$$v(y)=\dfrac{C_{2}}{\textrm{n}(y)}=\dfrac{\textrm{constant}}{\textrm{n}(y)} \tag{03}$$$$ where $$\:\textrm{n}(y)\:$$ the variable refraction index.

So, to find the path $$\:y(x)\:$$ for given function $$\:\textrm{n}(y)\:$$ we must solve the following differential equation $$$$\dfrac{\sqrt{1+y'^{\,2}}}{\textrm{n}(y)}=\textrm{constant} \tag{04}$$$$

In case that $$\:v(y)=\sqrt{2g\,y}\:$$ equation (04) is expressed as $$$$\sqrt{y\left(1+y'^{\,2}\right)}=\textrm{constant} \tag{05}$$$$

This is the equation of brachistochrone.(2) That is the brachistochrone is the light path in a region with variable refraction index $$$$\textrm{n}(y)=\dfrac{\textrm{constant}}{\sqrt{y}} \tag{06}$$$$

The path is valid inversely from point $$\:\mathrm{A}_{4}\:$$ to point $$\:\mathrm{A}_{0}\:$$ as in Figure below. This is the path through a medium with increasing refraction index.

(1) About Snell's Law : Why one should follow Snell's law for shortest time?.

(2) About Brachistochone : What is the position as a function of time for a mass falling down a cycloid curve?.

• I assume that the (y) is the speed of light constant? (n) is the index refraction, and what would (x) be in this case? – C. Jordan Aug 17 '19 at 14:48
• C. Jordan : (a) No, $\:y\:$ is the vertical coordinate (downwards in 1rst Figure, upwards in 2nd Figure) (b) Yes, $\:n(y)\:$ is the refraction index, function of the vertical coordinate $\:y\:$ (c) $\:x\:$ is the horizontal coordinate (to the right in 1rst Figure, to the left in 2nd Figure). – Frobenius Aug 17 '19 at 15:43
• Okay, so, I just want to understand this better with the method here, with the various points of the graph, finding the different degrees and the refractive indices, would help find some sort of constant gradient refractive index for a curved beam? – C. Jordan Aug 17 '19 at 16:56