dx said:
Snell's law can be done purely geometrically too. Just draw the path from point A in the first medium to point B in the second medium with angles \theta_{1} and \theta_{2} respectively with the normal. Now move the point at which the path touches the medium interface by a little amount \Delta x. You will see that if the length of one path increases, the other will decrease. From the geometry it's easy to see that the first order changes are \Delta x sin \theta_{1} and \Delta x \sin \theta_{2} (with opposite signs). The changes in the time are simply these changes in path distance multiplied by the respective refractive index. So for the total first order change in time to be equal to zero, we need
n_{1}\Delta x sin \theta_{1} = n_{2}\Delta x sin \theta_{2}.
Canceling the \Delta xs we get Snell's law.
But that's just doing Calculus of Variations. It just so happens that the only functions you need to consider are piecewise linear. Varying the "point at which the ray crosses the boundary" is the same as varying \alpha in y(x, \alpha) = y(x) + \alpha \eta(x). It just so happens that you can visualize this variation, because the path is a physical path in 3-dimensional space; whereas, in the Lagrangian formulation of mechanics, the paths being considered are paths in N-dimensional configuration space.
The only purely
geometrical way of deriving Snell's Law that I know is by means of wave optics. Consider a plane wave incident on medium 2 at an angle \theta_1 moving at velocity c / n_1. In medium 2, it moves with a velocity c / n_2. Using Huygens' Principle, one can see that the wave fronts must emerge at an angle \theta_2 given by Snell's Law.
The idea of "shortest time" doesn't enter into it; and in fact, the entire concept of minimizing time is suspect in the first place. After all, why should the light know where it is going? The geometrical argument shows that refraction is an entirely local effect, and the math just
happens to work out such that the path of each ray of light minimizes time along itself.
In a similar vein, my derivation of the EL equations from Newton's laws shows that they are an entirely local effect, and the math "just works out" so that the path of the system through configuration space minimizes some quantity known as "action".
P.S.: You can get pretty-looking sines, cosines, logarithms, etc., in Latex by preceding them with a backslash such as "\sin \theta_1": \sin \theta_1.