Return 1 if edges intersect completely (endpoints excluded)
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
186510
def without_nodes(self, edge: Edge) -> 'BipartiteGraph[TLeft, TRight, TEdgeValue]':
        """"""
        return BipartiteGraph(((n1, n2), v) for (n1, n2), v in self._edges.items() if n1 != edge[0] and n2 != edge[1])
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;
    }
401646
private static boolean checkCollide(Area area, Collidable other)
    {
        final List<Rectangle> others = other.getCollisionBounds();
        final int size = others.size();
        for (int i = 0; i < size; i++)
        {
            final Area current = others.get(i);
            if (area.intersects(current))
            {
                return true;
            }
        }
        return false;
    }
160457
def coords_intersect(self):
        
        return set.intersection(*map(
            set, (getattr(arr, 'coords_intersect', arr.coords) for arr in self)
            ))
571851
def intersection(self, other, ignore_conflicts=False):
        """"""
        result = self.copy()
        result.intersection_update(other, ignore_conflicts)
        return result
1009556
private boolean intersection(
            final long pX0, final long pY0, final long pX1, final long pY1,
            final long pX2, final long pY2, final long pX3, final long pY3
    ) {
        return SegmentIntersection.intersection(
                pX0, pY0, pX1, pY1,
                pX2, pY2, pX3, pY3, mOptimIntersection);
    }
319710
@Pure   
	private static boolean intersectEdgeEdge(
			int i0, int i1, int con, double Ax, double Ay, double[] v, double[] u1, double[] u2) {
		// [v,b] is the segment that contains the point v
		// [c,d] is the segment [u1,u2]

		// A is the vector (v,b)
		// B is the vector (d,c)
		// C is the vector (c,v)

		double Bx = u1[i0] - u2[i0];
		double By = u1[i1] - u2[i1];
		double Cx = v[i0]  - u1[i0];
		double Cy = v[i1]  - u1[i1];

		// 

		double f = Ay * Bx - Ax * By;
		double d = By * Cx - Bx * Cy; // Line equation: V+d*A

		boolean up = false;
		boolean down = false;

		if (f>0) {
			switch(con) {
			case 1: // First point must be ignored
				down = (d>0);
				up = (d<=f);
				break;
			case 2: // Second point must be ignored
				down = (d>=0);
				up = (d<f);
				break;
			case 3: // First and Second points must be ignored
				down = (d>0);
				up = (d<f);
				break;
			default:
				down = (d>=0);
				up = (d<=f);
			}
		}
		else if (f<0) {
			switch(con) {
			case 1: // First point must be ignored
				down = (d>=f);
				up = (d<0);
				break;
			case 2: // Second point must be ignored
				down = (d>f);
				up = (d<=0);
				break;
			case 3: // First and Second points must be ignored
				down = (d>f);
				up = (d<0);
				break;
			default:
				down = (d>=f);
				up = (d<=0);
			}
		}

		if (up&&down) {
			double e = Ax * Cy - Ay * Cx;
			if (f>=0) return ((e>=0)&&(e<=f));
			return ((e>=f)&&(e<=0));
		}

		return false;
	}
941238
def FindMatchingPolys(self, start_point, end_point, max_radius=150):
    
    matches = []
    for shape in self._name_to_shape.itervalues():
      if start_point.GetDistanceMeters(shape.GetPoint(0)) < max_radius and \
        end_point.GetDistanceMeters(shape.GetPoint(-1)) < max_radius:
        matches.append(shape)
    return matches
1283023
def do_bb_intersect(a, b):
    """"""
    return a.p1.x <= b.p2.x \
        and a.p2.x >= b.p1.x \
        and a.p1.y <= b.p2.y \
        and a.p2.y >= b.p1.y
800244
def without_edge(self, edge: Edge) -> 'BipartiteGraph[TLeft, TRight, TEdgeValue]':
        """"""
        return BipartiteGraph((e2, v) for e2, v in self._edges.items() if edge != e2)
175502
def _intersect(self, label, xmin, ymin, xmax, ymax):
        """"""
        left = np.maximum(label[:, 0], xmin)
        right = np.minimum(label[:, 2], xmax)
        top = np.maximum(label[:, 1], ymin)
        bot = np.minimum(label[:, 3], ymax)
        invalid = np.where(np.logical_or(left >= right, top >= bot))[0]
        out = label.copy()
        out[:, 0] = left
        out[:, 1] = top
        out[:, 2] = right
        out[:, 3] = bot
        out[invalid, :] = 0
        return out
19380
def find_next_intersection(edges, i, e)
	    for j in i..(edges.count-1)
		e2 = edges[j][:edge]
		next if !e2 || e.connected?(e2)
		intersection = e.intersection(e2)
		return [intersection, j] if intersection
	    end
	    nil
	end
955462
def intersect(self,range2):
    
    if not self.overlaps(range2): return None
    return type(self)(self.chr,max(self.start,range2.start)+self._start_offset,min(self.end,range2.end),self.payload,self.dir)
1193359
int intersectionWithEnvelope2D(Envelope2D clipEnv2D,
			boolean includeEnvBoundary, double[] segParams,
			double[] envelopeDistances) {
		Point2D p1 = getStartXY();
		Point2D p2 = getEndXY();

		// includeEnvBoundary xxx ???

		int modified = clipEnv2D.clipLine(p1, p2, 0, segParams,
				envelopeDistances);
		return modified != 0 ? 2 : 0;

	}
473435
def intersects(self, x):
        """"""
        r1 = Rect(x)
        if self.isEmpty or self.isInfinite or r1.isEmpty:
            return False
        r = Rect(self)
        if r.intersect(r1).isEmpty:
            return False
        return True
412315
public boolean intersects(PhysicalEntityChain rpeh, boolean ignoreEndPoints)
	{
		for (PhysicalEntity pe1 : pes)
		{
			for (PhysicalEntity pe2 : rpeh.pes)
			{
				if (pe1 == pe2)
				{
					if (ignoreEndPoints)
					{
						if ((pes[0] == pe1 || pes[pes.length-1] == pe1) &&
							(rpeh.pes[0] == pe2 || rpeh.pes[rpeh.pes.length-1] == pe2))
						{
							continue;
						}
					}

					return true;
				}
			}
		}
		return false;
	}