I am modelling the propagation of light rays from one point to another, with some object in between, in this case a disk to simplify matters, and I compared the travel times of a refracted ray and a hypothetical, unphysical "direct ray" unaffected by refraction. Let's say the ray starts at position $A = (-0.18, 0.668)$ (all in meters) and is received at position $B = (-0.02, -0.668)$. A disk of radius $r = 0.1$ is located in the centre at $(0,0)$, with an index of refraction of $n_d = 1.45$. A refracted ray that hits position $B$ can be determined to intersect the circle first at $ C_1 = (-0.0081, 0.0997)$ and then leave the circle at $C_2 = (-0.0209, -0.0978)$. On the other hand, a straight ray that ignores refraction will intersect the circle at $E_1 = (-0.1, 0.0)$ and $E_2 = (-0.0972, -0.0236)$. Geometry of the system in question From these values, we can calculate the travel times:

$$ t_{\text{refr}} = (d_1 + d_3) / c * n_a + d_2 / c * n_d $$ $$ t_{\text{dir}} = (d_1' + d_3') / c * n_a + d_2' / c * n_d $$ with $d_1 = |\overline{AC_1}|$, $d_2 = |\overline{C_1C_2}|$, $d_3 = |\overline{C_2B}|$ and $d_i'$ the same but replacing $C_j$ with $E_j$. $n_a$ also denotes the index of refraction of air. The resulting travel time is then $t_{\text{refr}} = 4.84 \, \text{ns}$ and $t_{\text{dir}} = 4.53 \, \text{ns}$, i.e. the direct ray actually has a shorter travel time because its travel length in the object is far shorter than for the refracted ray. Usually, however, if people talk about Snell's law, it is said that the straight line has a longer travel time (and is therefore not taken) because of its longer way through the object, i.e. refraction causes the travel length through the medium of higher refractive index to shorten, which is the opposite of what is happening here.

Where, exactly, does this discrepancy come from? The literature examples usually include only one medium transition, is that it? Or is it the shape of my object? Is there something I'm missing?

  • $\begingroup$ It would be very helpful if you could provide a sketch showing the geometry and labeling points. It would also be helpful if you could use simpler locations ... they seem to be arbitrary and perhaps unnecessarily "not nice". Perhaps to make your point it has to be the way you describe, but it's hard to visualize. $\endgroup$
    – garyp
    Mar 14, 2022 at 17:14
  • $\begingroup$ You could remove your concern about having only one medium transition and simplify the problem by placing point $B$ be inside the disk. $\endgroup$
    – Andrew
    Mar 14, 2022 at 20:21
  • $\begingroup$ @garyp the points are like that because they resemble our set-up, unfortunately... but I added a sketch, so hopefully that clears things up a bit. $\endgroup$
    – DominikR
    Mar 15, 2022 at 8:57
  • $\begingroup$ @Andrew that is not our objective, unfortunately, we need to have two medium transitions. we cannot receive a signal by placing an antenna inside an object (without destroying the object in some way) $\endgroup$
    – DominikR
    Mar 15, 2022 at 8:57
  • $\begingroup$ If you're doing a simulation, you could still use this as a way to check your code is working correctly. Anyway, it's just a thought. $\endgroup$
    – Andrew
    Mar 15, 2022 at 12:36

1 Answer 1


Fermat's principle doesn't require light to take the shortest optical path (i.e. minimum travel time) between the start and end points. What it does require is that the optical path length of the ray be stationary along the trajectory, which in very simple terms means that slight deformations of the trajectory don't change the optical path length much. Trajectories that are local minima of the optical path length are stationary (with one caveat), and stationary paths are often (but not always) local minima. The path you depict where the ray refracts is a local minimum, and thus a possible path light can take between the two points you specify. The direct path isn't stationary (you can tell because it doesn't obey Snell's law at the interfaces), so it is not a possible path.

To answer your question, it is not generally true that a straight path has a greater optical path length in a non-uniform medium, as your example demonstrates. It is also not generally true when the start and end points are in different media. It applies in the simple case where the start and end points are in different media separated by a planar interface, which is how Snell's law is typically derived from Fermat's principle. Snell's law itself is quite generally valid however: if you choose your start and end points to be arbitrarily close to a (smooth) interface, that interface is essentially flat.

EDIT: At second glance, from your diagram it doesn't look like the first refraction of your ray obeys Snell's law, so you may have made a mistake in determining the points $C_1$ and $C_2$.

  • $\begingroup$ So that means if a trajectory is a local minimum, small variations in the trajectory cause only second order variations in the travel time, while for general trajectories, these variations will cause first order changes in the travel time, more or less? Also, thanks for pointing it out, I indeed switched up a minus sign! $\endgroup$
    – DominikR
    Mar 16, 2022 at 9:52
  • $\begingroup$ @DominikR That's correct. The possibility of "first-order changes in travel time" normally means that you can find small variations that will reduce the travel time, so that trajectory is not a local minimum. $\endgroup$
    – Puk
    Mar 16, 2022 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.