Minimizing Trail Length Problem

Vectorville is located 4 km from a bike trail (as indicated on the diagram by point A). Function Junction is located 6 km away from the same trail (as indicated by point B). These points are 8 km apart. A rest stop is to be built somewhere between A and B to minimize the length of new trail that will be built to directly link both villages to the rest stop. Drag R to try to find the minimum length.