Minimizing the total time spent on a hike

Topic:
Calculus
This demo goes with Activity 3.11 in Section 3.4 of Active Calculus by Matt Boelkins. You can download the book here: http://faculty.gvsu.edu/boelkinm/Home/Download.html. (The distances have been changed from 3 and 2 kiolmeters to 6 and 4 kilometers.) Drag the point labelled Z to change the point where the hiker leaves the road and enters the woods. The distances traveled in each place are marked on the diagram; the time spent on the road, in the woods, and combined are shown above the diagram.