check if two segments intersect
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)
}
842697
function intersects(p1, q1, p2, q2) {
    if ((equals(p1, p2) && equals(q1, q2)) ||
        (equals(p1, q2) && equals(p2, q1))) return true;
    return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 &&
           area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;
}
810886
public static boolean getBoolean(MemorySegment[] segments, int offset) {
		if (inFirstSegment(segments, offset, 1)) {
			return segments[0].getBoolean(offset);
		} else {
			return getBooleanMultiSegments(segments, offset);
		}
	}
131495
def intersect(self, r):
        """"""
        if not len(r) == 4:
            raise ValueError("bad sequ. length")
        self.x0, self.y0, self.x1, self.y1 = TOOLS._intersect_rect(self, r)
        return self
264194
function(p1, p2, check_walls, check_items) {
        var minres = false;
        
        // collide with walls
        if(check_walls) {
          for(var i=0,n=this.walls.length;i<n;i++) {
            var wall = this.walls[i];
            var res = line_intersect(p1, p2, wall.p1, wall.p2);
            if(res) {
              res.type = 0; // 0 is wall
              if(!minres) { minres=res; }
              else {
                // check if its closer
                if(res.ua < minres.ua) {
                  // if yes replace it
                  minres = res;
                }
              }
            }
          }
        }
        
        // collide with items
        if(check_items) {
          for(var i=0,n=this.items.length;i<n;i++) {
            var it = this.items[i];
            var res = line_point_intersect(p1, p2, it.p, it.rad);
            if(res) {
              res.type = it.type; // store type of item
              if(!minres) { minres=res; }
              else { if(res.ua < minres.ua) { minres = res; }
              }
            }
          }
        }
        
        return minres;
      }
107834
def find_segment(self, ea):
        
        for seg in self.seglist:
            if seg.startea <= ea < seg.endea:
                return seg
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
10162
def intersect(a, b):
    
    if a[x0] == a[x1] or a[y0] == a[y1]:
        return False
    if b[x0] == b[x1] or b[y0] == b[y1]:
        return False
    return a[x0] <= b[x1] and b[x0] <= a[x1] and a[y0] <= b[y1] and b[y0] <= a[y1]
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;
    }
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;
	}
1343061
private void checkEntry(long index, Segment segment, Segment compactSegment) {
    try (Entry entry = segment.get(index)) {
      // If an entry was found, only remove the entry from the segment if it's not a tombstone that has been released.
      if (entry != null) {
        checkEntry(index, entry, segment, compactSegment);
      } else {
        compactSegment.skip(1);
      }
    }
  }
138088
function (p, p1, maxIndex, minIndex) {
		var points = this._originalPoints,
			p2, p3;

		minIndex = minIndex || 0;

		// Check all previous line segments (beside the immediately previous) for intersections
		for (var j = maxIndex; j > minIndex; j--) {
			p2 = points[j - 1];
			p3 = points[j];

			if (L.LineUtil.segmentsIntersect(p, p1, p2, p3)) {
				return true;
			}
		}

		return false;
	}
92453
public boolean intersect(Envelope2D other) {
		if (isEmpty() || other.isEmpty()) {
			setEmpty();
			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;

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

		if (!bIntersecting)
			setEmpty();

		return bIntersecting;
	}
95568
def check_splits_equals(splits1, splits2):
  """"""
  if set(splits1) ^ set(splits2):  # Name intersection should be null
    return False
  for _, (split1, split2) in utils.zip_dict(splits1, splits2):
    if split1.num_shards != split2.num_shards:
      return False
  return True
1241974
def intersect(d1, d2):
    """"""
    return dict((k, d1[k]) for k in d1 if k in d2 and d1[k] == d2[k])
438191
def intersect(self, *queries):
        ''''''
        q = self._clone()
        q.intersections += queries
        return q
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