Let's say I have two polygons. I know the co-ordinates of both polygons. Now, I need to check whether the first Polygon is completely inside of second polygon? IN this figure only 1 polygon is completely inside of red polygon.
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.Sign up to join this community
One way would be to compile a list of all edge pairs, and check whether any edges cross each other. If none do, you can choose any point inside one of the polygons, and check weather it is is the second polygon by using the following theorem:
A point is inside a polygon if a ray from this point crosses the polygon's edges an odd number of times.
If the point is inside both, then one of the polygons is inside the other.