Rank: 128393 based on 0 downloads (last 30 days) and 0 file submitted
photo

Florian

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Florian
Updated File Comments Rating
19 Feb 2009 Inhull Efficient test for points inside a convex hull in n dimensions Author: John D'Errico

Thank you very much for this code. Particularly thanks to John for explaining me a problem I had with the code:

I have tried the following:
tms=rand(1000,5);
in = inhull(tms,tms);
disp(length(find(in==0)))

which gave roughly ~319

as John points out:
"those 319 points were almost certainly on the surface of the convex hull.

Try this slight modification of your code instead.

tms=rand(1000,5);
in = inhull(tms,tms,[],1.e-13);
disp(length(find(in==0)))
0

See that I've used a tolerance this time. The linear algebra used in the test is done in floating point arithmetic in matlab, as it must be. Without a tolerance, any test done in floating point arithmetic is suspect. By default that tolerance is zero, but this is also why I allowed the user a tolerance at all. "

Thanks John!!!!!

Contact us