Helper method for {@link #intersects(Ray3)}. Determines whether the ray intersects the box
at the plane where x equals the value specified.
499584
protected boolean intersectsX (IRay3 ray, float x) {
        IVector3 origin = ray.origin(), dir = ray.direction();
        float t = (x - origin.x()) / dir.x();
        if (t < 0f) {
            return false;
        }
        float iy = origin.y() + t*dir.y(), iz = origin.z() + t*dir.z();
        return iy >= _minExtent.y && iy <= _maxExtent.y &&
            iz >= _minExtent.z && iz <= _maxExtent.z;
    }
372811
public boolean contains(Shape other) {
    	if (other.intersects(this)) {
    		return false;
    	}
    	
    	for (int i=0;i<other.getPointCount();i++) {
    		float[] pt = other.getPoint(i);
    		if (!contains(pt[0], pt[1])) {
    			return false;
    		}
    	}
    	
    	return true;
    }
648155
function intersects(num, pos, angle)
{
    angle %= 4;
    var fig = getTransformedFigure(num, angle, pos);
    for (var i=0; i < fig.length; i+= 2)
    {
        var x = fig[i];
        var y = fig[i+1]
        if (y < 0)
            return true;
        if (x < 0)
            return true;
        if (x >= cupsize[0])
            return true;
        if (y >= cupsize[1])
            return true;
        if (cup[x + y*cupsize[0]])
            return true;
    }
    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;
    }
1185974
public boolean intersects(Geometry geometry) {
		if (isEmpty()) {
			return false;
		}
		if (exteriorRing.intersects(geometry)) {
			return true;
		}
		if (interiorRings != null) {
			for (LinearRing interiorRing : interiorRings) {
				if (interiorRing.intersects(geometry)) {
					return true;
				}
			}
		}
		return false;
	}
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;
    }
941420
protected int isBetter3D(Box a, Box b, Space space) {
		int compare = Long.compare(a.getVolume(), b.getVolume());
		if(compare != 0) {
			return compare;
		}
		// determine lowest fit
		a.fitRotate3DSmallestFootprint(space);
		b.fitRotate3DSmallestFootprint(space);

		return Long.compare(b.getFootprint(), a.getFootprint()); // i.e. smaller i better
	}
206200
@Pure
	private static boolean intersectsCoplanarTriangle(
			int i0, int i1, int con, double[] s1, double[] s2, double[] u1, double[] u2, double[] u3) {
		double Ax,Ay;

		Ax = s2[i0] - s1[i0];
		Ay = s2[i1] - s1[i1];

		// test edge U0,U1 against V0,V1
		if (intersectEdgeEdge(i0, i1, con, Ax, Ay, s1, u1, u2)) return true;
		// test edge U1,U2 against V0,V1
		if (intersectEdgeEdge(i0, i1, con, Ax, Ay, s1, u2, u3)) return true;
		// test edge U2,U1 against V0,V1
		if (intersectEdgeEdge(i0, i1, con, Ax, Ay, s1, u3, u1)) return true;

		return false;
	}
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;
  }
1034231
public boolean clashesWith(MapElementContainer other) {
        // if either of the elements is always drawn, the elements do not clash
        if (Display.ALWAYS == this.display || Display.ALWAYS == other.display) {
            return false;
        }
        return this.getBoundaryAbsolute().intersects(other.getBoundaryAbsolute());
    }
18557
@Override
  public boolean intersects(IVersionRange yourRange)
  {
    return range1.intersects(yourRange) && range2.intersects(yourRange);
  }
786560
public static boolean intersects(Geometry one, Geometry two) {
		if (one == null || two == null || isEmpty(one) || isEmpty(two)) {
			return false;
		}
		if (Geometry.POINT.equals(one.getGeometryType())) {
			return intersectsPoint(one, two);
		} else if (Geometry.LINE_STRING.equals(one.getGeometryType())) {
			return intersectsLineString(one, two);
		} else if (Geometry.MULTI_POINT.equals(one.getGeometryType())
				|| Geometry.MULTI_LINE_STRING.equals(one.getGeometryType())) {
			return intersectsMultiSomething(one, two);
		}
		List<Coordinate> coords1 = new ArrayList<Coordinate>();
		List<Coordinate> coords2 = new ArrayList<Coordinate>();
		getAllCoordinates(one, coords1);
		getAllCoordinates(two, coords2);

		for (int i = 0; i < coords1.size() - 1; i++) {
			for (int j = 0; j < coords2.size() - 1; j++) {
				if (MathService.intersectsLineSegment(coords1.get(i), coords1.get(i + 1), coords2.get(j),
						coords2.get(j + 1))) {
					return true;
				}
			}
		}
		return false;
	}
1335040
private static boolean intersectsPoint(Geometry point, Geometry geometry) {
		if (geometry.getGeometries() != null) {
			for (Geometry child : geometry.getGeometries()) {
				if (intersectsPoint(point, child)) {
					return true;
				}
			}
		}
		if (geometry.getCoordinates() != null) {
			Coordinate coordinate = point.getCoordinates()[0];
			if (geometry.getCoordinates().length == 1) {
				return coordinate.equals(geometry.getCoordinates()[0]);
			} else {
				for (int i = 0; i < geometry.getCoordinates().length - 1; i++) {
					double distance = MathService.distance(geometry.getCoordinates()[i],
							geometry.getCoordinates()[i + 1], coordinate);
					if (distance < DEFAULT_DOUBLE_DELTA) {
						return true;
					}
				}
			}
		}
		return false;
	}
416013
public boolean intersects(BBox o) {
        // return (o.minLon < minLon && o.maxLon > minLon || o.minLon < maxLon && o.minLon >= minLon)
        //  && (o.maxLat < maxLat && o.maxLat >= minLat || o.maxLat >= maxLat && o.minLat < maxLat);
        return this.minLon < o.maxLon && this.minLat < o.maxLat && o.minLon < this.maxLon && o.minLat < this.maxLat;
    }
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);
    }
1198425
public boolean intersects( Geometry geometry, boolean usePrepared ) {
        if (!getEnvelope().intersects(geometry.getEnvelopeInternal())) {
            return false;
        }
        if (usePrepared) {
            if (preparedGeometry == null) {
                preparedGeometry = PreparedGeometryFactory.prepare(getGeometry());
            }
            return preparedGeometry.intersects(geometry);
        } else {
            return getGeometry().intersects(geometry);
        }
    }
952351
def triangle_intersects_plane(mesh, tid, plane):
    
    dists = [point_to_plane_dist(mesh.verts[vid], plane)
             for vid in mesh.tris[tid]]
    side = np.sign(dists)
    return not (side[0] == side[1] == side[2])