From just thinking about the problem, my first thought, is if it's polygons, then you should have the equations of the line segments which make up it's sides. All you have to do is see if any segment from polygon1 intersects any segment from polygon2. How to find the intersection of 2 lines has a well known solution, called "simultaneous equations".