Convex polygon
The judging method of convex polygon:
1) Angle Method:
Determines whether the inner angle of each vertex is less than 180 degrees, if less than 180 degrees, is convex, if greater than 180 degrees, it is concave polygon.
2) Convex Package method:
This method first calculates the convex hull of the polygon, the definition of convex hull is not mentioned here, first of all, it is certain that convex hull is a convex polygon. If the computed convex polygon has as many points as the original polygons, it indicates that the polygon is convex, otherwise it is a concave polygon.
3) Vertex convexity method
The direction of the polygon and the smoothness of the current vertex are judged by using a vector fork or a signed area of the triangle that is centered on the current vertex.
Assume that the current contiguous three vertices are p1,p2,p3 respectively. Calculate the p1p2,p2p3 of the vector, or calculate the area of the Triangle P1P2P3, if the result is greater than 0, it means that the P3 point is on the left side of the segment P1 and P2, and the vertex of the polygon is a counterclockwise sequence. Then the next front and back of the composition of the cross-multiplication of the vector, if in the calculation, a negative value, then this polygon concave polygon, if all the vertices are calculated, the result is greater than 0, the polygon is convex.
The method of judging the geometrical convex polygon (not finished)