Inchull - In convex hull

Version 1.3.0.0 (3.2 KB) by Hugo
Test if a point is inside the convex hull of a set of points
275 Downloads
Updated 20 Apr 2015

View License

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
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Bounding Regions in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.3.0.0

Example added

1.2.0.0

.

1.1.0.0

Description modified

1.0.0.0