There are 2 areas (java.awt.geom.Area
) area1 and area2. I need to verify if area2 is inside area1? (area1 contains area2).
I have tried:
areaDelta = (Area)area1.clone();
areaDelta.add(area2);
return areaDelta.equals(area1);
But it doesnt always work as it should (If the bounds of area2 are on the bounds of area1, it returns true, should return false).
In fact I have 2 polygons (java.awt.Polygon) and I need the Polygon.contains(Polygon) method, may be this can be easier then for areas.
Any ideas?
Polygons can be convex and non-convex.