Inactive Tutor answered 08/11/23
I don't think calculating a rectangle is going to work for you in this case. Think about if you have a triangle and you want to check if it is inside of another triangle. If I draw a rectangle from points on the triangle, that rectangle could always be larger than the area of the triangle, and the rectangle could be partially outside the bounds of the container triangle while the triangle itself is not. If the polygons in question are *regular* polygons, then all you have to do is know all of the vertices and calculate if the vertices are inside of the area of the other. If all of the vertices are inside, then the entire polygon is inside. Unfortunately that is not the case with *irregular* polygons. Are you dealing with potentially irregular polygons?