TITLE: Find distance between a point and a catenary curve
QUESTION [0 upvotes]: I'm not a mathematician, but a programmer who needs to understand how I can calculate the distance.
I have a catenary curve defined with parameters a, p, and q. Also, I have defined the start and end of the curve.
The question is how can I calculate the distance between any point and the catenary curve?
For now, I have a catenary divided into many small segments and treat them like straight lines. This solution is very slow because I have to iterate through all segments and choose the closest one.
@Edit:
I have parameters of catenary and a few points in 3D space. Now I have to calculate the distance from these points to the catenary curve.
My curve is determined by:
$$a.\cosh(\frac{x - p}{a}) + q$$

REPLY [1 votes]: If $(x_0,y_0)$ is your point, you need to find the $x$ which minimizes $(x -x_0)^2+(a.\cosh(\frac{x-p}{a})+q-y_0)^2$. To do this, differentiate and put the result equal to $0$. This gives
$$2(x-x_0)+2\sinh(\frac{x-p}{a})\Big(a.\cosh(\frac{x-p}{a})+q-y_0\Big)=0.$$
This will need a numerical method to solve, like Newton's Method.
{"set_name": "stack_exchange", "score": 0, "question_id": 4513761}