Determines if two rectangles, each input as a tuple
        (xmin, xmax, ymin, ymax), intersect.
194706
def boxes_intersect(box1, box2):
    """"""
    xmin1, xmax1, ymin1, ymax1 = box1
    xmin2, xmax2, ymin2, ymax2 = box2
    if interval_intersection_width(xmin1, xmax1, xmin2, xmax2) and \
            interval_intersection_width(ymin1, ymax1, ymin2, ymax2):
        return True
    else:
        return False
1249879
public Optional<Range<T>> intersect(Tuple2<T, T> other) {
        return Tuple2.intersect(this, other).map(Range::new);
    }
384543
public boolean intersects(long minimum, long supremum) {
    rangeSanityCheck(minimum, supremum);
    short minKey = Util.highbits(minimum);
    short supKey = Util.highbits(supremum);
    int len = highLowContainer.size;
    short[] keys = highLowContainer.keys;
    // seek to start
    int index = Util.unsignedBinarySearch(keys, 0, len, minKey);
    int pos = index >= 0 ? index : -index - 1;
    short offset = Util.lowbits(minimum);
    while (pos < len && Util.compareUnsigned(supKey, keys[pos]) > 0) {
      Container container = highLowContainer.getContainerAtIndex(pos);
      if (container.intersects(offset, 1 << 16)) {
        return true;
      }
      offset = 0;
      ++pos;
    }
    return pos < len
            && supKey == keys[pos]
            && highLowContainer.getContainerAtIndex(pos)
                               .intersects(0, (int)((supremum - 1) & 0xFFFF) + 1);
  }
631051
def do_intersect(bb1, bb2):
    
    if bb1[0] + bb1[2] < bb2[0] or bb2[0] + bb2[2] < bb1[0]:
        return False
    if bb1[1] + bb1[3] < bb2[1] or bb2[1] + bb2[3] < bb1[1]:
        return False
    return True
1159687
public static int intersectLine (double x1, double y1, double x2, double y2, double rx1,
                                     double ry1, double rx2, double ry2) {
        // LEFT/RIGHT/UP
        if ((rx2 < x1 && rx2 < x2) || (rx1 > x1 && rx1 > x2) || (ry1 > y1 && ry1 > y2)) {
            return 0;
        }

        // DOWN
        if (ry2 < y1 && ry2 < y2) {

        } else {
            // INSIDE
            if (x1 == x2) {
                return CROSSING;
            }

            // Build bound
            double bx1, bx2;
            if (x1 < x2) {
                bx1 = x1 < rx1 ? rx1 : x1;
                bx2 = x2 < rx2 ? x2 : rx2;
            } else {
                bx1 = x2 < rx1 ? rx1 : x2;
                bx2 = x1 < rx2 ? x1 : rx2;
            }
            double k = (y2 - y1) / (x2 - x1);
            double by1 = k * (bx1 - x1) + y1;
            double by2 = k * (bx2 - x1) + y1;

            // BOUND-UP
            if (by1 < ry1 && by2 < ry1) {
                return 0;
            }

            // BOUND-DOWN
            if (by1 > ry2 && by2 > ry2) {
            } else {
                return CROSSING;
            }
        }

        // EMPTY
        if (x1 == x2) {
            return 0;
        }

        // CURVE-START
        if (rx1 == x1) {
            return x1 < x2 ? 0 : -1;
        }

        // CURVE-END
        if (rx1 == x2) {
            return x1 < x2 ? 1 : 0;
        }

        if (x1 < x2) {
            return x1 < rx1 && rx1 < x2 ? 1 : 0;
        }
        return x2 < rx1 && rx1 < x1 ? -1 : 0;
    }
762497
public boolean intersects (double x, double y, double w, double h)
    {
        return _bounds.intersects(x, y, w, h);
    }
693067
static boolean intersect(int[] verts, int a, int b, int c, int d) {
        if (intersectProp(verts, a, b, c, d))
            return true;
        else if (between(verts, a, b, c) || between(verts, a, b, d) || between(verts, c, d, a)
                || between(verts, c, d, b))
            return true;
        else
            return false;
    }
295347
public static int intersectQuads (float x1, float y1, float x2, float y2, float x3, float y3,
                                      float qx1, float qy1, float qx2, float qy2, float qx3,
                                      float qy3, float[] params) {
        float[] initParams = new float[2];
        float[] xCoefs1 = new float[3];
        float[] yCoefs1 = new float[3];
        float[] xCoefs2 = new float[3];
        float[] yCoefs2 = new float[3];
        int quantity = 0;

        xCoefs1[0] = x1 - 2 * x2 + x3;
        xCoefs1[1] = -2 * x1 + 2 * x2;
        xCoefs1[2] = x1;

        yCoefs1[0] = y1 - 2 * y2 + y3;
        yCoefs1[1] = -2 * y1 + 2 * y2;
        yCoefs1[2] = y1;

        xCoefs2[0] = qx1 - 2 * qx2 + qx3;
        xCoefs2[1] = -2 * qx1 + 2 * qx2;
        xCoefs2[2] = qx1;

        yCoefs2[0] = qy1 - 2 * qy2 + qy3;
        yCoefs2[1] = -2 * qy1 + 2 * qy2;
        yCoefs2[2] = qy1;

        // initialize params[0] and params[1]
        params[0] = params[1] = 0.25f;
        quadNewton(xCoefs1, yCoefs1, xCoefs2, yCoefs2, initParams);
        if (initParams[0] <= 1 && initParams[0] >= 0 && initParams[1] >= 0 && initParams[1] <= 1) {
            params[2 * quantity] = initParams[0];
            params[2 * quantity + 1] = initParams[1];
            ++quantity;
        }
        // initialize params
        params[0] = params[1] = 0.75f;
        quadNewton(xCoefs1, yCoefs1, xCoefs2, yCoefs2, params);
        if (initParams[0] <= 1 && initParams[0] >= 0 && initParams[1] >= 0 && initParams[1] <= 1) {
            params[2 * quantity] = initParams[0];
            params[2 * quantity + 1] = initParams[1];
            ++quantity;
        }

        return quantity;
    }
493027
public static <T> boolean intersectsAll(T[] a1, T[] a2) {
        for (T anA1 : a1) {
            if (!contains(a2, anA1)) {
                return false;
            }
        }

        for (T anA2 : a2) {
            if (!contains(a1, anA2)) {
                return false;
            }
        }

        return true;
    }
773255
public void intersect(OpenBitSet other) {
        int newLen= Math.min(this.wlen,other.wlen);
        long[] thisArr = this.bits;
        long[] otherArr = other.bits;
        // testing against zero can be more efficient
        int pos=newLen;
        while(--pos>=0) {
            thisArr[pos] &= otherArr[pos];
        }
        if (this.wlen > newLen) {
            // fill zeros from the new shorter length to the old length
            Arrays.fill(bits,newLen,this.wlen,0);
        }
        this.wlen = newLen;
    }
493534
def intersection(self,other):
        
        if self.bounds[0] < other.bounds[0]:
            i1,i2 = self,other
        else:
            i2,i1 = self,other

        if self.is_disjoint(other):
            return Interval((1,0),(True,True))

        bounds = [None,None]
        included = [None,None]
        #sets are not disjoint, so i2.bounds[0] in i1:
        bounds[0] = i2.bounds[0]
        included[0] = i2.included[0]

        if i2.bounds[1] in i1:
            bounds[1] = i2.bounds[1]
            included[1] = i2.included[1]
        else:
            bounds[1] = i1.bounds[1]
            included[1] = i1.included[1]

        return Interval(bounds,included)
339923
public boolean intersects(Geometry geometry) {
		if (geometry == null) {
			return false;
		}
		Coordinate[] arr1 = getCoordinates();
		Coordinate[] arr2 = geometry.getCoordinates();
		for (int i = 0; i < arr1.length - 1; i++) {
			for (int j = 0; j < arr2.length - 1; j++) {
				if (Mathlib.lineIntersects(arr1[i], arr1[i + 1], arr2[j], arr2[j + 1])) {
					return true;
				}
			}
		}
		return false;
	}
191199
def intersects(self, other):
        ''''''
        return self.CHROM == other.CHROM and self.POS <= other.ref_end_pos() and other.POS <= self.ref_end_pos()
283929
public static int intersectShape (IShape s, float x, float y, float w, float h) {
        if (!s.bounds().intersects(x, y, w, h)) {
            return 0;
        }
        return intersectPath(s.pathIterator(null), x, y, w, h);
    }
348010
function intersects (data, p1, q1, p2, q2) {
  return orient(data, p1, q1, p2) !== orient(data, p1, q1, q2) &&
    orient(data, p2, q2, p1) !== orient(data, p2, q2, q1)
}
192743
def _edges_intersect(self, edge1, edge2):
        
        h12 = self._intersect_edge_arrays(self.pts[np.array(edge1)], 
                                          self.pts[np.array(edge2)])
        h21 = self._intersect_edge_arrays(self.pts[np.array(edge2)], 
                                          self.pts[np.array(edge1)])
        err = np.geterr()
        np.seterr(divide='ignore', invalid='ignore')
        try:
            out = (0 < h12 < 1) and (0 < h21 < 1)
        finally:
            np.seterr(**err)
        return out
761637
@Pure
	protected final boolean boundsIntersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
		final Rectangle2d bounds = getBoundingBox();
		assert bounds != null;
		return bounds.intersects(rectangle);
	}