|
|
| 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 0.813646 seconds.
inhull: Elapsed time is 0.242993 seconds. |
| Acknowledgements |
This file inspired
Inpolyhedron Are Points Inside A Volume?.
|
| 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.
|
| 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 |
| 08 Apr 2011 |
Repaired example in the help |
| 06 Sep 2012 |
minor changes for a tiny speed boost |
|
Contact us