public boolean intersects(Rectangle2D r,double margin){
  double tw=clip[6] - clip[0];
  double th=clip[7] - clip[1];
  double rw=r.getWidth();
  double rh=r.getHeight();
  if (rw < 0 || rh < 0 || tw < 0 || th < 0) {
    return false;
  }
  double tx=clip[0];
  double ty=clip[1];
  double rx=r.getX() - margin;
  double ry=r.getY() - margin;
  rw+=rx + 2 * margin;
  rh+=ry + 2 * margin;
  tw+=tx;
  th+=ty;
  return ((rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx)&& (th < ty || th > ry));
}

public boolean intersects ( Rectangle2D r , double margin ) { double tw = clip [ 6 ] - clip [ 0 ] ; double th = clip [ 7 ] - clip [ 1 ] ; double rw = r . getWidth ( ) ; double rh = r . getHeight ( ) ; if ( rw < 0 || rh < 0 || tw < 0 || th < 0 ) { return false ; } double tx = clip [ 0 ] ; double ty = clip [ 1 ] ; double rx = r . getX ( ) - margin ; double ry = r . getY ( ) - margin ; rw += rx + 2 * margin ; rh += ry + 2 * margin ; tw += tx ; th += ty ; return ( ( rw < rx || rw > tx ) && ( rh < ry || rh > ty ) && ( tw < tx || tw > rx ) && ( th < ty || th > ry ) ) ; }
indicates if this clip intersects the given rectangle expanded by the additional margin pace .
