In the above java applet, there are two different regions (green and yellow). How to chose a path such that minimizes the travel time?
Sounds familar? Fermat's principle states that: