Rotating jamming case -- Critical tangent

Source: Internet
Author: User
Critical tangent

The critical tangent (usually called CS line) between two convex polygon is the tangent of different sides of the two polygon separated lines. In other words, they separate polygon.
The CS line can be applied to motion planning, visibility, and range fitting.

It is about two polygon and their two critical tangent.

 

Note that the data is given in the standard format. The CS line will only intersection two polygon at the two vertices. Therefore, a CS line is determined by the vertex pair between polygon.
The following conclusions describe this point:

Given two Convex PolygonP,Q, Two verticesP(I),Q(J) (Respectively belongPAndQ) Determine a CS line if and only if:

    1. P(I),Q(J.
    2. P(I-1 ),P(I+ 1) line (P(I),Q(J) Side, at the same timeQ(J-1 ),Q(J+ 1) located at another time.

Using this conclusion, the CS line can be easily determined. Test is required only when the pair points between polygon are located. Therefore, Toussaint is recommended to use a rotary card shell. Assume that the polygon is given in the standard form and the vertices are arranged clockwise. Consider the following process:

    1. calculate the vertex with the smallest Y coordinate value on P (called yminp ) the vertex with the largest Y coordinate value on q (called ymaxq ).
    2. construct two tangent LP and SCSI for the polygon at yminp and ymaxq . place the corresponding polygon on the right of the polygon. LP and SCSI have different directions, in addition, yminp and ymaxq become a pair of attention points between polygon.
    3. order P ( I ) = yminp , q ( j ) = ymaxq . ( P ( I ), q ( j )) A pair of vertex points between polygon. Check whether P ( I -1) exists ), P ( I + 1) online ( P ( I ), q ( j )) and q ( j -1 ), q ( j + 1) on the other side. If yes, ( P ( I ), q ( j ) determines a CS line.
    4. rotate the two lines until one of them overlaps with the edges of the corresponding polygon.
    5. A new pair of Attention Points is fixed. If both lines overlap with edges, a total of three pairs of vertex points (the combination of original vertex and new vertex) need to be considered. Perform the test above for all pair of vertex points.
    6. Repeat steps 4 and 5 until the new point is ( yminp , ymaxq ).
    7. output the CS line.

ThisAlgorithmBasically, by rotating the tangent around the polygon, We Can sequentially find the pair vertex between all polygon. Execute all necessary tests after each pair of vertices is determined. After the above process is completed, all the critical tangent is found.
The running time of an algorithm is determined by steps 1 and 6.O (N)(All detection takes constant time. BecauseO (N)The total cost isO (N)).

For Learning convex polygon, the final operation is convex polygon vector sum.

 

Original article address:Http://cgm.cs.mcgill.ca /~ Orm/cslines.html

 

Please indicate the source for reprinting. Thank you!

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.