I have polygons defined with their vertices's, and i need to calculate areas of their union and intersection. The most upsetting thing is that it is implemented in Mapping Toolbox, but i can't buy it. Does anyone knows how to make a fast algorithm to calculate it? Thank you for your time.
To be able to decide whether two convex polygons are intersecting (touching each other) we can use the Separating Axis Theorem. Essentially: If two convex polygons are not intersecting, there exists a line that passes between them. Such a line only exists if one of the sides of one of the polygons forms such a line.
On the Edit Polygons menu, click Merge. Select two adjacent polygons. The new polygon has the attributes of the last polygon selected.
What is the point of intersection of two sides of a polygon? Hi Tyler. Formally, mathematicians call them vertices (plural for vertex). But more casually, we just call them corners.
What is the difference between union and intersection? A union of sets produces a new set containing each element present in the original sets. An intersection of sets produces a new set that contains only the elements that the original sets have in common.
You just need to find the area of intersection ; the area of the union is trivially obtained from that. The PolygonIntersection package from FEX might be useful.
I would do like this:
The resulting set of vertices should make up the union of the polygons.
For the intersection you simply remove all vertices in S that are outside of both polygon 1 and 2 (in the third step).
(You can look up point intersection and "inside-polygon"-checks elsewhere ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With