Code covered by the BSD License  

Highlights from
Minimum Enclosing Circle

3.0

3.0 | 3 ratings Rate this file 14 Downloads (last 30 days) File Size: 2.54 KB File ID: #6457
image thumbnail

Minimum Enclosing Circle

by Yazan Ahed

 

02 Dec 2004 (Updated 18 Oct 2011)

A code to find the minimum circle enclosing a set of given 2d points (Cartesian).

| Watch this File

File Information
Description

This code takes an input of a set of given (x,y) points in the Cartesian coordinates and returns the center and radius of the minimum circle enclosing the points.

The code is not optimized and may have bugs, but for the many cases I tried it seems to work.

The code was written based on the very nice Java applete found here: http://heyoka.cs.uiuc.edu/~thite/mincircle/
Credit are due mainly to author of the applet.

Acknowledgements
This submission has inspired the following:
Minimum Enclosing Circle
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
27 Feb 2005 xunkai wei

great
Do you have interest in developing enclosing ball algorithm for object covering ?

27 Feb 2005 yazan Ahed

Hi Xunkai, thanks!

I'm not really an expert in this stuff, I just needed to include such function in a code that analyzes chemical structure, so I translated the java code mentioned in the description to Matlab.
May be if you check the website of the guy who did the applet and see if you can contact him, maybe he will be interested.

29 Jun 2005 Sergei Koptenko

Probably a good program but it is quite impossible to understand how it should be used from the help part of the function.
1) "n: number of points given". Is this should be n=length(points_coordinates_vector)? If yes, it shouldn't be the input parameter but a code line inside the body of the function (n=length(points); for instance).
2) What is "pts"? is it the coordinates of points? what is the format of this vector?
3) What is the meaning of parameter "m"? If it always should be 1, then again why is it a input parameter not just a line (m=1;) inside the code?
4) From the description of the parameter "bnry" is absolutely unclear what it does and how it should be specified.

A good practice in writing a Matlab functions is to give at least one example how to use the function inside of the help section of the code.

 

28 Dec 2006 Can Aysal

The code is wrong! it does not work... sometimes it gives circles that do not enclose all the pts.

Please login to add a comment or rating.
Updates
07 Dec 2004

Correction to the help in minCircle.m

10 Dec 2004

Correction to the help in minCircle.m

18 Oct 2011

Addressing complains about the code not working.

Tag Activity for this File
Tag Applied By Date/Time
smallest circle Yazan Ahed 22 Oct 2008 07:37:11
minimal circle Yazan Ahed 22 Oct 2008 07:37:11
enclosing circle Yazan Ahed 22 Oct 2008 07:37:11
enclosing circle Georg D 21 Jul 2011 12:05:07

Contact us at files@mathworks.com