File Exchange

## Distance between points and ellipse

version 1.3.0.0 (9.77 KB) by Rody Oldenhuis

### Rody Oldenhuis (view profile)

Compute the distances between an ellipse and an arbitrary number of points, in 3D

Updated 10 Jun 2018

The solution to the problem of calculating the distance between an ellipse and a point is less than straightforward. The problem can be solved analytically however, which boild down to solving a quartic equation in cos(f), with (f) the true anomaly on the ellipse.
This submission implements this and computes the distances between any 3-D ellipse and an arbitrary number of 3-D points.
This is part of:
Ik-Sung Kim: "An algorithm for finding the distance between two ellipses". Commun. Korean Math. Soc. 21 (2006), No.3, pp.559-567

If you find this work useful, please consider a small donation:
https://www.paypal.me/RodyO/3.5

### Cite As

Rody Oldenhuis (2020). Distance between points and ellipse (https://www.github.com/rodyo/FEX-distancePointEllipse), GitHub. Retrieved .

xiaoqing

### xiaoqing (view profile)

okay, so for the example in your .m file to work, u,v need to be normalized before calculating the coordinates of those two points.

xiaoqing

### xiaoqing (view profile)

a = [2.0 1.2];
b = [0.5 1.0];
c = {[0,0,0],[1,3,0]}; % location of centers

u = {[1,1,0], [1,0,0]}; % both oriented in XY-plane
v = {[-1,1,0], [0,1,0]}; % to visualize them more easily

does not seem to calculate a correct minimum distance?