convex

How do I determine if two convex polygons intersect?

帅比萌擦擦* 提交于 2019-11-27 04:25:58
Suppose there are a number of convex polygons on a plane, perhaps a map. These polygons can bump up against each other and share an edge, but cannot overlap. To test if two polygons P and Q overlap, first I can test each edge in P to see if it intersects with any of the edges in Q . If an intersection is found, I declare that P and Q intersect. If none intersect, I then have to test for the case that P is completely contained by Q , and vice versa. Next, there's the case that P == Q . Finally, there's the case that share a few edges, but not all of them. (These last two cases can probably be

How do I determine if two convex polygons intersect?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 11:11:45
问题 Suppose there are a number of convex polygons on a plane, perhaps a map. These polygons can bump up against each other and share an edge, but cannot overlap. To test if two polygons P and Q overlap, first I can test each edge in P to see if it intersects with any of the edges in Q . If an intersection is found, I declare that P and Q intersect. If none intersect, I then have to test for the case that P is completely contained by Q , and vice versa. Next, there\'s the case that P == Q .