Method for Determining irregular areas using the mouse (I)-convex hull implementation.

Source: Internet
Author: User

Convex Hull definition:

The inner angle is 360 °. It looks like a convex polygon. Each angle does not exceed 180 °.

Convex Hull formation:

A convex hull is enclosed by N ending and ending vectors.

Convex bag:

The graph consists of 5 points and 5 vectors.

1. P0-> P1

2. P1-> P2

3. P2-> p3

4. P3-> p4

5. P4-> P0

Based on the vector, we can use the right-hand rule to know the 2D normal of the 2D vector. Then we can determine whether the vertex is inside or out of the convex hull.

AlgorithmImplementation:

1. Output packet. Record the coordinates of points. then configure the vector ..

2. After the vector, you can modify the positive and negative numbers of x y to find the normal of the vector.

3. then determine whether it is the same side or different side of the normal.

4. If all the five normal maps are determined to be inner, they can be determined within the convex hull.

AlgorithmCode:




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.