|
|
| File Information |
| Description |
Testing if a point is inside a convex hull can be done in a variety of ways. Inhull converts the problem into a dot product. If not supplied, it also computes the convex hull too. Inhull also attempts to avoid memory problems, doing the computation in smaller blocks when appropriate.
Here is a comparison of inhull to tsearchn:
n = 500;
m = 100;
p = 5;
xyz = rand(m,p);
testpts = rand(n,p)-.1;
tic
tess = delaunayn(xyz);
in0 = ~isnan(tsearchn(xyz,tess,testpts));
toc
tic
in1 = inhull(testpts,xyz);
toc
tsearchn: Elapsed time is 641.046321 seconds.
inhull: Elapsed time is 0.610503 seconds. |
| MATLAB release |
MATLAB 7.0.1 (R14SP1)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (15) |
| 26 Apr 2006 |
Liketo Stayanonymous
|
|
|
| 01 May 2006 |
Mia Ginsburg
|
|
|
| 23 Oct 2006 |
Quan Wen
|
|
|
| 06 Mar 2007 |
John Galt
|
|
|
| 28 Mar 2007 |
Jon KoS
|
|
|
| 31 Oct 2007 |
Yonas T. Weldeselassie
|
|
|
| 08 Nov 2007 |
Lee Shunn
|
|
|
| 22 Feb 2008 |
Jayveer Thakoor
|
|
|
| 23 Jun 2008 |
Titus Edelhofer
|
|
|
| 02 Dec 2008 |
Luigi Giaccari
|
|
|
| 02 Dec 2008 |
Luigi Giaccari
|
|
|
| 05 Dec 2008 |
Nagarjuna
|
|
|
| 19 Feb 2009 |
Florian
|
|
|
| 02 Mar 2009 |
Navid Samavati
|
|
|
| 28 May 2009 |
David Gingras
|
|
|
| Updates |
| 13 Mar 2006 |
Added a tolerance on the tests |
| 17 Mar 2006 |
Version 2.0: Repaired a problem when the hull has degenerate facets. |
| 05 Apr 2006 |
Fix a problem in 2-d or 3-d, catching degenerate facets |
| 30 Oct 2006 |
Sped up by removing a spare repmat from a loop, also changed the memblock size to 1e6, for an additional 3x speed enhancement. Thanks to Paul Jackson for these ideas. |
|
MATLAB Central Terms of Use
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 Terms prior to use.
Contact us at files@mathworks.com