I'm working on an algorithm which should check if two polygons, described by their vertex coordinates, are: one inside the other, are intersecting or are separated
image below describe this three cases: 
i'm thinking about how to do it but i'm not having any idea. Any suggestion?

