The method of judging the geometrical convex polygon (not finished)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.