public boolean intersects(Polygon2D polygon){
  for (  Point2D p : polygon.points)   if (contains(p))   return true;
  for (  Point2D p : points)   if (polygon.contains(p))   return true;
  return false;
}

public boolean intersects ( Polygon2D polygon ) { for ( Point2D p : polygon . points ) if ( contains ( p ) ) return true ; for ( Point2D p : points ) if ( polygon . contains ( p ) ) return true ; return false ; }
determines if a polygon intersects the polygon
