6 ms·
In my experience, the method described here works very well in practice: http://wwwf.imperial.ac.uk/~rn/distance2ellipse.pdf http://wwwf.imperial.ac.uk/~rn/dis
by ubasu 9y ago
In my experience, the method described here works very well in practice:
http://wwwf.imperial.ac.uk/~rn/distance2ellipse.pdf http://wwwf.imperial.ac.uk/~rn/distance2ellipse.pdf
(this is linked to from the stackoverflow post)
Finding the closest point for an ellipsoid is more challenging in practice, because one needs to take a different parametrization near a pole, and sometimes conjugate gradient is necessary to get convergence.
- 0xfaded 9y agoAlthough I didn't implement this myself, the plot accompanying the answer shows that if correctly implemented, this method is unstable in some regions inside the ellipse.