A variant of Heron's shortest distance problem (with three points instead of two)
Everybody knows how to draw an ellipse from two focus points :
To extend the method to the case of three points, the gardener need a more sophisticated tool, for example such as sketched on the next figure :
Better, avoid to discuss the technical details and improvements required for practical use and for accuracy !
It is far simpler to use a computer and convenient software. The next figure shows an example of the curves drawn for various $D=AP+BP+CP=\text{constant}$.
Given a straight line, the shortest distance D is obtained for the curve tangent to the line.
Without loss of generality, one can place the first point at the origine of the axes, that is A$(0,0)$. The second point B can be placed on the x-axis. Also, AB can be taken as unit of lengths, that is B$(1,0)$. And the third point is C$(k,h)$.
The equation of the given straight line is $y=\alpha x+\beta$
So, the parameters of the problem are only four : $\alpha,\beta,k,h$
From P$(x,y)$, the distance is $$D=AP+BP+CP=\sqrt{x^2+y^2}+\sqrt{(x-1)^2+y^2}+\sqrt{(x-k)^2+(y-h)^2}$$
$$D=\sqrt{x^2+(\alpha x+\beta)^2}+\sqrt{(x-1)^2+(\alpha x+\beta)^2}+\sqrt{(x-k)^2+(\alpha x+\beta-h)^2}$$ For the minimum of D, we have : $\quad\frac{dD}{dx}=0.\quad$ So, the corresponding value(s) of $x$ is among the roots of the next equation : $$\frac{x+\alpha(\alpha x+\beta)}{\sqrt{x^2+(\alpha x+\beta)^2}}+\frac{x-1+\alpha(\alpha x+\beta)}{\sqrt{(x-1)^2+(\alpha x+\beta)^2}}+\frac{x-k+\alpha(\alpha x+\beta-h)}{\sqrt{(x-k)^2+(\alpha x+\beta-h)^2}}=0$$ The equation can be transformed into a polynomial equation, but of degree $>4$. Thus, in general, there is no closed form solution.
Of course, the solution can approximately computed thanks to numerical calculus.
Just for fun : With the tool sketched above, make the point P follow the given straight line while one end of the rope is taut, until it becomes no longer possible to continue. You have got to the minimum distance (half the final length of the rope). But that is shamefully far from mathematics !