Inchull - In convex hull
Test if a point "testPt" is inside the convex hull of a set of points "pts". This is done by solving a linear program. As it does not require to compute the convex hull, it can be used in high dimension. This is an alternative to the inhull function of John D'Errico that works well in small dimensions. In that case, it is faster that the linear programming approach. However the inhull solution does not work in high dimension as it computes the convex hull.
The code also provides a vector "weights" that verifies: testPt = pts*weights with sum(weights)=1 and weights>=0. This is helpful to check that a point is really inside the convex hull.
Cite As
Hugo (2024). Inchull - In convex hull (https://www.mathworks.com/matlabcentral/fileexchange/50569-inchull-in-convex-hull), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.