This one is a basic optimization problem. It's quite famous, being discussed in Heron's Catoptrica (On Mirrors from the Greek word Katoptron Catoptron = Mirror) that, in all likelihood, saw the light of day some 2000 years ago.
Two points A and B are given on the same side of a line l. Find a point M on l such that the sum of distances from A and B to M is minimal.
with the equality reached only when M lies on AB', in which case clearly the two angles coincide.
Heron's problem has applications to curved surfaces, ellipse for one.
Note: the problem has been known in Japan. It appeared on a now lost sangaku tablet from 1830 written in the Yamagata prefecture [Fukagawa and Pedoe, problem 4.1.1]. The Japanese variant underscored the computational aspects of the solution:
P is a variable point in the given segment AB, and C is a fixed point on the perpendicular AC to the line AB, and D is fixed, on the same side of AB as C, and lies on the perpendicular BD to AB. AC = c,BD = d, and AB = k. Find AP = p such that CP + PD is a minimum when P moves on AB.
It is not difficult to surmise the solution from the diagram
When P satisfies the minimality requirement, triangles APC and BPD' are similar from which