# point of intersection with 2D polygons

This topic is 3456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Supposedly there are 2 polygon, let's say they are both convex, and supposedly they are colliding with each other. How do i find where are they colliding? Basically i want a way to find the intersection(s) of their edges. ~thanks

##### Share on other sites
Intersection of convex polygons is implemented in the Wm4ConvexPolygon2.* files at my Mathematics page. In particular, look at the functions FindIntersection (intersection of two convex polygons) and FindAllIntersections (intersection of multiple convex polygons). The algorithm uses clipping one polygon against each edge of the other polygon. (There is an asymptotically faster method; see Joseph O'Rourke's book "Computational Geometry in C".)

##### Share on other sites
I am using Java to program, but that shouldn't matter since programming languages are alike, but one think i don't get is that the findIntersection method returns a boolean, but what I am trying to find a the point at where they intersect, not if they are intersecting or not.

##### Share on other sites
The 'bool' return indicates whether or not there is an intersection. The last parameter of the function is an "output" parameter and stores the convex polygon of intersection. The simplest choice for a point of intersection is one of the output polygon's vertices.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 16
• 18
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633362
• Total Posts
3011527
• ### Who's Online (See full list)

There are no registered users currently online

×