简体   繁体   中英

Finding Whether A Point Is In The Convex Hull Generated By A Set Of Points

I need to calculate convex hull from a set of points.

Dimensions of points is usually 10 ~ 30D

Size of the set is small, usually 2 ~ 10

And the task I need is to judge whether a point is inside the convex hull constructed from the point set.

What are some algorithms to perform that, or are there any existing libraries that I could use?

Note:this raw sketch of algorithm, it requires revision.It can output wrong result (see comments below)

The following is one of a number of possible solutions to your problem.

Let D - dimension of your space, N - count of your points. You can use following algorithm:

You should compute projection convex hull for each coordinate plane of your space. You will get D convex hulls. Complexity of this step is D * N * log N

Then you should test, whether each projection of you point is located inside each appropriated convex hull. Complexity of this step is D * N (using native algorithm)

Overall execution complexity = D * N * Log N.

Note: basic idea of this algorithm is to boil down computing convex hull on plane with following testing of location of point.

PS Of course, you can get some degenerate cases, where convex hull can be line segment or just point. But these cases can be easlity treated

PPS This algorithm only allows to check whether point lies inside convex hull or on its boundary

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM