(For my purposes "polygons" do not included self-intersecting polygons or polygons with holes - just simple (concave or convex) polygons.)
I have found various suggestions for this problem, which are mainly based around the following:
If there are no intersections between the edges of Polygon1 and the edges of Polygon2, and at least one vertex of Polygon2 is "inside" Polygon1, then Polygon1 contains Polygon2.
(eg see the accepted answer here)
However, the devil is in the detail:
Does "inside" Polygon1 include "on an edge of" Polygon1? Clearly it must, otherwise in diagram F (see the image linked below) Polygon2 (red) would have no vertex "inside" Polygon1 (blue) and so fail the above test, when it should pass.
Does an "intersection" of two edges include a point at the end of one of the edges (ie a vertex)? If "yes", then diagrams A and E below have intersections and so fail the test when they should pass. But if "no", then diagrams B, C and D have no intersections and so pass the test when they should fail.
(NB diagrams A, B and C have vertices of Polygon2 on edges of Polygon1, diagrams D and E vice versa.)
I can't work out a condition to test which distinguishes correctly between these various cases. I'd be grateful for any pointers?