Step 1 of 4: Travel time of the broken path
Intuition
Light can be viewed as 'choosing' the kink point on the interface so that the total travel time is smallest — like a lifeguard who runs along the beach then swims diagonally: because running is faster than swimming, the optimal route is not a straight line.
Analysis
Suppose the ray travels from point in medium 1 to point in medium 2, crossing the interface at position . The perpendicular distances of and to the interface are and , and the projected separation along the interface is . By the Pythagorean theorem the two legs have lengths and ; dividing by the speeds , in each medium and adding gives the total time .