Efficient test for points inside a convex hull in n dimensions
11,3K téléchargements
Mise à jour 6 sept. 2012

Afficher la licence

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;

tess = delaunayn(xyz);
in0 = ~isnan(tsearchn(xyz,tess,testpts));
in1 = inhull(testpts,xyz);

tsearchn: Elapsed time is 0.813646 seconds.
inhull: Elapsed time is 0.242993 seconds.

Citation pour cette source

John D'Errico (2024). Inhull (, MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R14SP1
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
En savoir plus sur Bounding Regions dans Help Center et MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version

minor changes for a tiny speed boost

Repaired example in the help