Checks whether the frustum intersects the specified box.
170208
public IntersectionType intersectionType (Box box) {
        // exit quickly in cases where the bounding boxes don't overlap (equivalent to a separating
        // axis test using the axes of the box)
        if (!_bounds.intersects(box)) {
            return IntersectionType.NONE;
        }

        // consider each side of the frustum as a potential separating axis
        int ccount = 0;
        for (int ii = 0; ii < 6; ii++) {
            // determine how many vertices fall inside/outside the plane
            int inside = 0;
            Plane plane = _planes[ii];
            for (int jj = 0; jj < 8; jj++) {
                if (plane.distance(box.vertex(jj, _vertex)) <= 0f) {
                    inside++;
                }
            }
            if (inside == 0) {
                return IntersectionType.NONE;
            } else if (inside == 8) {
                ccount++;
            }
        }
        return (ccount == 6) ? IntersectionType.CONTAINS : IntersectionType.INTERSECTS;
    }
465957
public static boolean intersects(SpatialComparable box1, SpatialComparable box2) {
    final int dim = assertSameDimensionality(box1, box2);
    for(int i = 0; i < dim; i++) {
      if(box2.getMax(i) < box1.getMin(i) || box1.getMax(i) < box2.getMin(i)) {
        return false;
      }
    }
    return true;
  }
919876
public boolean intersect(Envelope3D other) {
		if (isEmpty() || other.isEmpty())
			return false;

		if (other.xmin > xmin)
			xmin = other.xmin;

		if (other.xmax < xmax)
			xmax = other.xmax;

		if (other.ymin > ymin)
			ymin = other.ymin;

		if (other.ymax < ymax)
			ymax = other.ymax;

		if (other.zmin > zmin)
			zmin = other.zmin;

		if (other.zmax < zmax)
			zmax = other.zmax;

		boolean bIntersecting = xmin <= xmax && ymin <= ymax && zmin <= zmax;

		if (!bIntersecting)
			setEmpty();

		return bIntersecting;
	}
1133023
public boolean intersects(Shape shape) {
        if(shape instanceof Circle) {
            Circle other = (Circle)shape;
    		float totalRad2 = getRadius() + other.getRadius();
    		
    		if (Math.abs(other.getCenterX() - getCenterX()) > totalRad2) {
    			return false;
    		}
    		if (Math.abs(other.getCenterY() - getCenterY()) > totalRad2) {
    			return false;
    		}
    		
    		totalRad2 *= totalRad2;
    		
    		float dx = Math.abs(other.getCenterX() - getCenterX());
    		float dy = Math.abs(other.getCenterY() - getCenterY());
    		
    		return totalRad2 >= ((dx*dx) + (dy*dy));
        }
        else if(shape instanceof Rectangle) {
            return intersects((Rectangle)shape);
        }
        else {
            return super.intersects(shape);
        }
	}
1332079
@Override
	@Pure
	public boolean intersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
		if (boundsIntersects(rectangle)) {
			final Path2d p = toPath2D();
			return p.intersects(rectangle);
		}
		return false;
	}
143966
public boolean intersects(double minLon, double maxLon, double minLat, double maxLat) {
        return this.minLon < maxLon && this.minLat < maxLat && minLon < this.maxLon && minLat < this.maxLat;
    }
837477
function intersectsPolygon( a, b ) {

	var p = a;

	do {

		if ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
						intersects( p, p.next, a, b ) ) {

			return true;

		}

		p = p.next;

	} while ( p !== a );

	return false;

}
774354
public boolean intersects (float x, float y, float w, float h) {
    tx().transform(intersectionTestPoint.set(x, y), intersectionTestPoint);
    tx().transform(intersectionTestSize.set(w, h), intersectionTestSize);
    float ix = intersectionTestPoint.x, iy = intersectionTestPoint.y;
    float iw = intersectionTestSize.x, ih = intersectionTestSize.y;

    if (scissorDepth > 0) {
      Rectangle scissor = scissors.get(scissorDepth - 1);
      return scissor.intersects((int)ix, (int)iy, (int)iw, (int)ih);
    }

    float tw = target.width(), th = target.height();
    return (ix + iw > 0) && (ix < tw) && (iy + ih > 0) && (iy < th);
  }
322962
public boolean intersects(double x, double y, double w, double h) {
		return intersects(new Rectangle2D.Double(x, y, w, h));
	}
1328981
def is_bbox_not_intersecting(self, other):
        """"""

        self_x_min, self_x_max, self_y_min, self_y_max = self.get_bbox()
        other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()

        return \
            self_x_min > other_x_max or \
            other_x_min > self_x_max or \
            self_y_min > other_y_max or \
            other_y_min > self_y_max
439184
def collides(self, other):
        """"""

        angle = self.angle
        width = self.width
        height = self.height

        if angle == 0:
            return other.collides(Rect(-0.5 * width,
                                       -0.5 * height, width, height))

        # Phase 1
        #
        #  * Form bounding box on tilted rectangle P.
        #  * Check whether bounding box and other intersect.
        #  * If not, then self and other do not intersect.
        #  * Otherwise proceed to Phase 2.

        # Now perform the standard rectangle intersection test.

        if self.is_bbox_not_intersecting(other):
            return False

        # Phase 2
        #
        # If we get here, check the edges of self to see
        #  * if one of them excludes all vertices of other.
        #  * If so, then self and other do not intersect.
        #  * (If not, then self and other do intersect.)

        return not self.is_edge_not_excluding_vertices(other)
1025622
def intersects(self, e):
    
    if self.chrom != e.chrom:
      return False

    if e.start >= self.start and e.start < self.end:
      return True
    if e.end > self.start and e.end <= self.end:
      return True
    if e.start < self.start and e.end > self.end:
      return True
    return False
1176291
function(frustum) {
        // Check if all coords of frustum is on plane all under plane
        var coords = frustum.vertices;
        var normal = this.normal.array;
        var onPlane = vec3.dot(coords[0].array, normal) > this.distance;
        for (var i = 1; i < 8; i++) {
            if ((vec3.dot(coords[i].array, normal) > this.distance) != onPlane) {
                return true;
            }
        }
    }
340222
function intersects(a, b) {
	return a.position[0] < b.position[0] + b.size[0] && a.position[0] + a.size[0] > b.position[0]
	    && a.position[1] < b.position[1] + b.size[1] && a.position[1] + a.size[1] > b.position[1]
}
5243
public boolean intersects(final Span s) {
    final int sstart = s.getStart();
    // either s's start is in this or this' start is in s
    return this.contains(s) || s.contains(this)
        || getStart() <= sstart && sstart < getEnd()
        || sstart <= getStart() && getStart() < s.getEnd();
  }
81111
function(obj) {
    if (obj.normal) { return obj.intersects(this); }
    return (!this.isParallelTo(obj) && this.distanceFrom(obj) <= Sylvester.precision);
  }
401885
@Override
	@Pure
	public boolean intersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
		if (boundsIntersects(rectangle)) {

			if (rectangle.intersects(getBoundingBox())) {
				return true;
			}

			if (this.isWidePolyline) {
				final Rectangle2afp<?, ?, ?, ?, ?, ?> box = rectangle.toBoundingBox();
				final double rminX = box.getMinX();
				final double rminY = box.getMinY();
				final double rmaxX = box.getMaxX();
				final double rmaxY = box.getMaxY();

				final double width = getWidth();

				boolean firstPoint;
				double px = 0;
				double py = 0;

				for (final PointGroup grp : groups()) {
					firstPoint = true;
					for (final Point2d pts : grp) {
						final double x = pts.getX();
						final double y = pts.getY();

						if (firstPoint) {
							firstPoint = false;
						} else if (MathUtil.min(
								Segment2afp.calculatesDistanceSquaredSegmentSegment(rminX, rmaxY, rmaxX, rmaxY, px, py, x, y),
								Segment2afp.calculatesDistanceSquaredSegmentSegment(rminX, rminY, rminX, rmaxY, px, py, x, y),
								Segment2afp.calculatesDistanceSquaredSegmentSegment(rmaxX, rminY, rmaxX, rmaxY, px, py, x, y))
								<= width * width) {
							return true;
						}

						px = x;
						py = y;
					}
				}
			} else {
				return toPath2D().intersects(rectangle);
			}
		}
		return false;
	}