Minimizing the total time spent on a hike

This demo goes with Activity 3.11 in Section 3.4 of [b]Active Calculus[/b] by Matt Boelkins. You can download the book here: [url][/url]. (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.

At what point should the hiker leave the road to minimize the total hiking time?