Tells what slice some point is in relative to a reference point.

@param referencePoint Object with x and y properties
@param otherPoint Object with x and y properties
@return zero based slice number
764926
function(referencePoint, otherPoint) {
    if (this.yDown) {
      if (otherPoint.y > referencePoint.y) {
        otherPoint = {
          x: otherPoint.x,
          y: referencePoint.y - (otherPoint.y - referencePoint.y)
        }
      } else if (otherPoint.y < referencePoint.y) {
        otherPoint = {
          x: otherPoint.x,
          y: referencePoint.y + (referencePoint.y - otherPoint.y)
        }
      }
    }

    var delta = vec2d(otherPoint).minus(vec2d(referencePoint))
    var weird = radiansToWeird(delta.angle())
    var compass = weirdToCompass(weird)

    for (var i = 0; i < this.slices.length; i++) {
      if (this.slices[i].contains(compass)) {
        return this.slices[i].number
      }
    }
  }
1048673
protected static <O> DoubleIntPair[] rankReferencePoints(DistanceQuery<O> distanceQuery, O obj, ArrayDBIDs referencepoints) {
    DoubleIntPair[] priority = new DoubleIntPair[referencepoints.size()];
    // Compute distances to reference points.
    for(DBIDArrayIter iter = referencepoints.iter(); iter.valid(); iter.advance()) {
      final int i = iter.getOffset();
      final double dist = distanceQuery.distance(obj, iter);
      priority[i] = new DoubleIntPair(dist, i);
    }
    Arrays.sort(priority);
    return priority;
  }
392144
public boolean touches(IndexRange other) {
        checkArgNotNull(other, "other");
        return other.end == start || end == other.start;
    }
498352
function (extraPoints) {
		var points = this._getProjectedPoints(),
			len = points ? points.length : 0;
		// Increment length by extraPoints if present
		len += extraPoints || 0;

		return !points || len <= 3;
	}
907672
public DelaunayTriangle neighborCCW( TriangulationPoint point )
    {
        if( point == points[0] )
        {
            return neighbors[2];
        }
        else if( point == points[1] )
        {
            return neighbors[0];
        }
        return neighbors[1];
    }
488853
def cmp(other)
			if (!other.kind_of?(IPv4))
				raise ArgumentError, "Expected an IPv4 object for 'other' but got a #{other.class}."
			end
			if (self.addr > other.addr)
				return 1
			elsif (self.addr < other.addr)
				return -1
			end
			return 0
		end
1338590
public boolean contains(Bbox other) {
		if (other.getX() < this.getX()) {
			return false;
		}
		if (other.getY() < this.getY()) {
			return false;
		}
		if (other.getEndPoint().getX() > this.getEndPoint().getX()) {
			return false;
		}
		if (other.getEndPoint().getY() > this.getEndPoint().getY()) {
			return false;
		}
		return true;
	}
476397
public int getAligSeq(Point point) {

		for (int pos=0; pos<alignmentSize; pos++){
			int i = getSeqPos(pos, point);
			Point t = getPanelPos(pos,i);

			if ( Math.abs(t.x - point.x) <= DEFAULT_CHAR_SIZE &&
					Math.abs(t.y-point.y) < DEFAULT_CHAR_SIZE ) return pos;
		}
		return -1;
	}
247209
@Pure
	public double distanceSquaredLine(Point3D point) {
		return distanceSquaredLinePoint(
				getX1(), getY1(), getZ1(),
				getX2(), getY2(), getZ2(),
				point.getX(), point.getY(), point.getZ());
	}
86915
function (other) {
        if (other instanceof tree.Dimension) {
            if (other.value > this.value) {
                return -1;
            } else if (other.value < this.value) {
                return 1;
            } else {
                return 0;
            }
        } else {
            return -1;
        }
    }
63746
public static JoinPoint unWrapJoinPoint(final JoinPoint point) {
        var naked = point;
        while (naked.getArgs() != null && naked.getArgs().length > 0 && naked.getArgs()[0] instanceof JoinPoint) {
            naked = (JoinPoint) naked.getArgs()[0];
        }
        return naked;
    }
6967
@Pure
	public double distanceSquaredSegment(Point3D point) {
		return distanceSquaredSegmentPoint(
				getX1(), getY1(), getZ1(),
				getX2(), getY2(), getZ2(),
				point.getX(), point.getY(), point.getZ());
	}
1343436
@Override
    public void meld(MergeableAddressableHeap<K, V> other) {
        BinaryTreeSoftAddressableHeap<K, V> h = (BinaryTreeSoftAddressableHeap<K, V>) other;

        // check same comparator
        if (comparator != null) {
            if (h.comparator == null || !h.comparator.equals(comparator)) {
                throw new IllegalArgumentException("Cannot meld heaps using different comparators!");
            }
        } else if (h.comparator != null) {
            throw new IllegalArgumentException("Cannot meld heaps using different comparators!");
        }

        if (rankLimit != h.rankLimit) {
            throw new IllegalArgumentException("Cannot meld heaps with different error rates!");
        }

        if (h.other != h) {
            throw new IllegalStateException("A heap cannot be used after a meld.");
        }

        // perform the meld
        mergeInto(h.rootList.head, h.rootList.tail);
        size += h.size;

        // clear other
        h.size = 0;
        h.rootList.head = null;
        h.rootList.tail = null;

        // take ownership
        h.other = this;
    }
1199897
public int getAligSeq(Point point) {


		int i1 = getSeqPos(0, point);


		Point t1 = getPanelPos(0,i1);

		if ( Math.abs(t1.x - point.x) <= DEFAULT_CHAR_SIZE &&
				Math.abs(t1.y-point.y) < DEFAULT_CHAR_SIZE ) {
			return 0;
		}

		int i2   = getSeqPos(1,point);
		Point t2 = getPanelPos(1,i2);

		if ( Math.abs(t2.x - point.x) < DEFAULT_CHAR_SIZE &&
				Math.abs(t2.y-point.y) < DEFAULT_CHAR_SIZE ) {
			return 1;
		}

		//System.out.println(" i1: " + i1 +" t1 : " + Math.abs(t1.x - point.x) + " " + Math.abs(t1.y-point.y));
		//System.out.println(i2);


		return -1;
	}
731541
function prevPoint(point, isSkipInnerOffset) {
  let node;
  let offset;

  if (point.offset === 0) {
    if (isEditable(point.node)) {
      return null;
    }

    node = point.node.parentNode;
    offset = position(point.node);
  } else if (hasChildren(point.node)) {
    node = point.node.childNodes[point.offset - 1];
    offset = nodeLength(node);
  } else {
    node = point.node;
    offset = isSkipInnerOffset ? 0 : point.offset - 1;
  }

  return {
    node: node,
    offset: offset,
  };
}
1069695
@Pure
	public boolean containsPoint(Point2D<?, ?> point, int groupIndex) {
		final int grpCount = getGroupCount();
		if (groupIndex < 0) {
			throw new IndexOutOfBoundsException(groupIndex + "<0"); //$NON-NLS-1$
		}
		if (groupIndex > grpCount) {
			throw new IndexOutOfBoundsException(groupIndex + ">" + grpCount); //$NON-NLS-1$
		}
		if (point == null) {
			return false;
		}

		for (int i = 0; i < getPointCountInGroup(groupIndex); ++i) {
			final Point2d cur = getPointAt(groupIndex, i);
			if (cur.epsilonEquals(point, MapElementConstants.POINT_FUSION_DISTANCE)) {
				return true;
			}
		}
		return false;
	}
1024782
private static boolean multiPointDisjointMultiPoint_(
			MultiPoint multipoint_a, MultiPoint multipoint_b, double tolerance,
			ProgressTracker progress_tracker) {
		return !multiPointIntersectsMultiPoint_(multipoint_a, multipoint_b,
				tolerance, progress_tracker);
	}