|
|
| File Information |
| Description |
Even if totally m-code, this routine is particulary fast in computing convex hull of 2D points. In many cases seems to be much faster than the matlab library routine. The reason is because differently from convhull, this algorithm jumps the call to unique function which can be very slow for large models .
Algorithm is very simple, it's based on cross product.
It is brand new, so please let me know if something goes wrong!
ConvHull2D returns indices into the X and Y vectors of the points on the convex hull.
Example: (convex hull of 1000000 random points)
N=1000000;
x=rand(N,1);
y=rand(N,1);
tic
chull=ConvHull2D(x,y);
toc
tic
chull2=convhull(x,y); %Matlab built-in routine
toc
Output:
Elapsed time is 0.104134 seconds.
Elapsed time is 1.207817 seconds.
For any problem,bug, information or suggestion just contact me at:
giaccariluigi@msn.com
|
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
Should work on all platforms |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 01 Dec 2008 |
cleared the code and fixed a little bug |
| 02 Dec 2008 |
grammars errors |
| 04 Dec 2008 |
Fixed a bug on colinear points |
| 06 Dec 2008 |
Improved treatment for colinear points |
| 09 Dec 2008 |
Another small bug fixed Thanks to liu-daohai report |
|
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.
Contact us at files@mathworks.com