As shown in the attached figure, let the horizontal distance from a to the intersection point b be x and the distance be y.
Y = √ (a 2+x 2)+c+√ [(d-x) 2+b 2], where a, b, c and d are known.
The question becomes: what is the value of x and the minimum value of y?
1, deformation:
y=√(a^2+x^2)+c+√[(x^2-2dx+d^2+b^2),
2. Derive the above formula y'=dy/dx.
y'=2x/√(a^2+x^2)+2(x- 1)/√(x^2-2dx+d^2+b^2),
3. Let y'=0 and get x0.
At this time, y(x0) is the extreme point, that is, the minimum value of y.
That is, when the horizontal distance between intersection B and starting point A is x0, and intersection B is between starting point A and destination point D, the distance is the shortest.