How do I determine if two convex polygons intersect?
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