Convex Polygon vector and
Two convex polygon on a given planePAndQ,PAndQAnd is recordedP+QDefinition:
P+
Q= {
P+
Q} All
PAnd
QOf
PAnd
Q.
Polygon vectors and Minkowski counts are also called in motion planning.
Considering the above definition, many questions can be raised through the query set.P+QAnd its nature. The subordinate results help us describe the polygon vectors and.
- P+QIs a convex polygon.
- Vertex setP+QYesvertex setPAndQAnd.
- Vertex setP+QYesPAndQParallel vertex set.
- GivenMAndNVertexPAndQ,P+QNo moreM+NVertex.
At last, the subordinate conclusions not only describe this problem, but also provide an incremental Calculation Method of vector sum for each vertex.
GivenP+QK vector of the SetZ(K) To meetZ(K) =P(I) +Q(J). Constructed inP(I) AndQ(J. The two lines areP(I) AndQ(J).Theta(I) AndPhi(J) (As shown in)
Therefore, the next vectorZ(K+ 1) equal:
- P(I+ 1) +Q(J) IfTheta(I) <Phi(J)
- P(I) +Q(J+ 1) IfTheta(I)>Phi(J)
- P(I+ 1) +Q(J+ 1) IfTheta(I) =Phi(J)
The following polygon and their vectors are used as an example.
Two convex polygon. The edges of the first polygon are marked in red, and those of the second polygon are marked in blue.
Returns the Vector Sum of the polygon. The edge color is the same as that of the original polygon.
With the above results, we can easily constructAlgorithmTo compute the vector and. The first vector can be the sum of the boundary vectors in a given direction (for exampleYNegative axis direction ). After the tangent is constructed, it is updated in the calculation angle, and the next point is very clear. All we need to do is rotate the two lines at the same time to the new position to determine the new angle.
The correctness of the algorithm comes from the main conclusion; it is linear time complexity, because each step only has one required vector and the vector in the set is determined, and they only haveM + nSo the total running time isM + n.
Original article address:Http://cgm.cs.mcgill.ca /~ Orm/vecsum.html
Please indicate the source for reprinting. Thank you!