= Solution
In each layer a minimum-time path is straight because the speed is constant there. The total time as a function of the two crossing positions is
$$
t(x_1,x_2)=\frac{\sqrt{1+x_1^2}}u+\frac{\sqrt{1+(x_2-x_1)^2}}v+\frac{\sqrt{1+(X-x_2)^2}}w.
$$
Setting its two <partial derivatives> to zero gives
$$
\frac{x_1}{u\sqrt{1+x_1^2}}=\frac{x_2-x_1}{v\sqrt{1+(x_2-x_1)^2}}=\frac{X-x_2}{w\sqrt{1+(X-x_2)^2}}.
$$
The angles in the held diagram are measured from the vertical interface normals, so these ratios are
$$
\boxed{\frac{\sin\alpha}{u}=\frac{\sin\beta}{v}=\frac{\sin\theta}{w}.}
$$
This is the layered-speed form of <Fermat's principle> and <Snell's law>. Signed horizontal displacements can be retained if the endpoint lies on the other side of the origin.
Back to article page