Code covered by the BSD License

### Highlights from Distance from points to an ellipse

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 2.16 KB File ID: #26261 Version: 1.3

# Distance from points to an ellipse

### Matthew Arthington (view profile)

04 Jan 2010 (Updated )

This function can calculate the geometric distance from one or more points to an ellipse in 2D.

File Information
Description

This function uses a dumb search to find the minimum distance between a point (or many points) and an ellipse. It has controllable accuracy which may be reduced for faster computation.

*Update 12 Jan 2010: Rody Oldenhuis has submitted a version of this file (possibly only for versions >=Matlab 2009a) that works for general 3D ellipses and should be more efficient than this one. Please see acknowledgements below.

*Update 08 Jan 2010: fixed a bug in original file

Acknowledgements

Distance Between Points And Ellipse inspired this file.

MATLAB release MATLAB 7.7 (R2008b)
18 Mar 2010 Matthew Arthington

### Matthew Arthington (view profile)

It finds the distance from points to an ellipse contour.

Comment only
17 Mar 2010 niki n

### niki n (view profile)

hi does this code find the min dis from point to the ellipse center or contour ?Any help will be greatly appreciated.thanks

Comment only
08 Jan 2010 Rody Oldenhuis

### Rody Oldenhuis (view profile)

While reading your post I was reminded of a long and tedious hunt I recently did for an efficient algorithm to find the distance between two confocal ellipses. One of the things I came across was exactly this problem (point - ellipse), and I remembered I still had the code for it somewhere.

So, I brushed it a bit, and I've just posted it (I made an acknowledgement to you as well). I hope my code can help you out.

Comment only
08 Jan 2010 1.1

Fixed a bug in original file.

11 Jan 2010 1.3

Added a link to point to a file that has been uploaded in response to my original description, which said that there exists a more efficient method than this, but it has not been implemented yet.