# Shortest distance from point to elliptic arc

I am trying to find a general method for calculating the shortest distance between an arbitrary point and an arc, where the arc is a 90 degree portion of an ellipse's boundary, and the ellipse's axes are both aligned to the Cartesian axes. I'm working in 2D, so both the point and the ellipse are coplanar. If the point is in the same quadrant as the arc, relative to the centre of the ellipse, then I believe that the problem is the same as calculating the distance from a point to anywhere on the whole ellipse's boundary, for which there are fairly straightforward methods (e.g. http://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf).

In the diagram, if the point is to the left of x1 or to the right of x2 or below y1, then the problem is straight forward.

However, I can't figure out what to do if the point P is as shown in the diagram.

• The ellipse is centered at the origin? – sinbadh Mar 13 '16 at 6:40
• It can be if that helps because we can translate the ellipse so that it is centred at the origin and simply translate the point as well – Rob B Mar 13 '16 at 6:45
• Suppose you have the ellipse $f(\theta)=(a\cos\theta,b\sin\theta)$, $\theta\in[0,2\pi)$. A conected closed arc $\mathcal{C}$ of the ellipse is of the form $f(\theta)=(a\cos\theta,b\sin\theta)$, $\theta\in[A,B]$ (closed in the topological sense), $0\le A<B<2\pi$. Fixing the point $P=(x_0,y_0)$, the problem is find $\begin{eqnarray}d((X,Y),P)^2&=&\min_{(x,y)\in\mathcal{C}}d((x,y),P)^2\\&=&\min_{(x,y)\in\mathcal{C}}\{(x-x_0)^2+(y-y_0)^2\}\\&=&\min_{\theta\in[A,B]}\{(a\cos\theta-x_0)^2+(b\sin\theta-y_0)^2\},\\\end{eqnarray}$ but I doubt it is an easy optimization problem. – sinbadh Mar 13 '16 at 7:00

You need to project the point $P$ orthogonally on the ellipse. This can be done by means of the solution of the quartic equation. Keep the two solutions corresponding to a minimum, and check if they belong to the useful portion of the ellipse.