[Computational geometry] The definition of a convex hull determines whether the pole is a point or not

[Study Notes Computational Geometry] Deng Junhui

Convex hull

The visual explanation is that a lot of nails are nailed on the table top. If all the nails are wrapped around with a rubber band, then the rubber band is surrounded by a convex hull.
The nail that supports the rubber band is called the pole.
As shown in the figure below, 1 2 7 8 5 3 is the pole.
Insert picture description here

How to judge whether X is a pole

Traverse all points X whether they are in a triangle

If a point is inside a triangle, this point must not play a supporting role. If a point cannot find such a triangle, that is, the triangle formed by the other three points contains it, then the point must For the extreme.
[Method 1]
Traverse all triangles to determine whether other stores are the extreme points, if not, mark False.
After traversing all triangles, the unmarked points at the end are poles.

To-Left test to determine whether the point is inside the triangle

[To-Left Test] Use
To-Left Test to judge whether the point X is inside a triangle,
that is, traverse the three sides of the triangle counterclockwise, if the point X is always on the directed line where the three sides are [counterclockwise] To the left. Then the point inside the triangle
[Helen Area]
is a directed area. The determinant is shown in the figure below.

To-Left Test

Insert picture description here

Determine whether it is a pole code

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_32507417/article/details/108087402