Returns the distance between the routing object of two entries.

@param e1 First entry
@param e2 Second entry
@return the distance between the two routing objects
972639
public final double distance(E e1, E e2) {
    return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
  }
819533
@Pure
	public static boolean epsilonEqualsDistance(Point2D<?, ?> p1, Point2D<?, ?> p2) {
		final double distance = p1.getDistance(p2);
		return distance >= -distancePrecision && distance <= distancePrecision;
	}
1066312
public static Integer distance(String h1, String h2) {
		HammingDistance distance = new HammingDistance();
		return distance.apply(h1, h2);
	}
769587
public static float distance(PointF p1, PointF p2){
        return (float) Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow(p2.y - p1.y,2));
    }
1130384
public static double distance(LatLong latLong1, LatLong latLong2) {
        return Math.hypot(latLong1.longitude - latLong2.longitude, latLong1.latitude - latLong2.latitude);
    }
1250698
public int calculateNodePathDistance(String nodePath1, String nodePath2) {
    String[] nodePathFragment1 = nodePath1.split("\\.");
    String[] nodePathFragment2 = nodePath2.split("\\.");

    int overlapBlock = 0;
    while (overlapBlock < nodePathFragment1.length
        && overlapBlock < nodePathFragment2.length
        && nodePathFragment1[overlapBlock].equals(nodePathFragment2[overlapBlock])) {
      overlapBlock++;
    }

    return nodePathFragment1.length + nodePathFragment2.length - overlapBlock * 2;
  }
1015341
public static int distance(String s1, String s2) {
    if (s1.length() == 0)
      return s2.length();
    if (s2.length() == 0)
      return s1.length();

    int s1len = s1.length();
    // we use a flat array for better performance. we address it by
    // s1ix + s1len * s2ix. this modification improves performance
    // by about 30%, which is definitely worth the extra complexity.
    int[] matrix = new int[(s1len + 1) * (s2.length() + 1)];
    for (int col = 0; col <= s2.length(); col++)
      matrix[col * s1len] = col;
    for (int row = 0; row <= s1len; row++)
      matrix[row] = row;

    for (int ix1 = 0; ix1 < s1len; ix1++) {
      char ch1 = s1.charAt(ix1);
      for (int ix2 = 0; ix2 < s2.length(); ix2++) {
        int cost;
        if (ch1 == s2.charAt(ix2))
          cost = 0;
        else
          cost = 1;

        int left = matrix[ix1 + ((ix2 + 1) * s1len)] + 1;
        int above = matrix[ix1 + 1 + (ix2 * s1len)] + 1;
        int aboveleft = matrix[ix1 + (ix2 * s1len)] + cost;
        matrix[ix1 + 1 + ((ix2 + 1) * s1len)] =
          Math.min(left, Math.min(above, aboveleft));
      }
    }

    // for (int ix1 = 0; ix1 <= s1len; ix1++) {
    //   for (int ix2 = 0; ix2 <= s2.length(); ix2++) {
    //     System.out.print(matrix[ix1 + (ix2 * s1len)] + " ");
    //   }
    //   System.out.println();
    // }
    
    return matrix[s1len + (s2.length() * s1len)];
  }
1296465
protected double distance(DBIDRef a, DBIDRef b) {
    ++distComputations;
    return distanceQuery.distance(a, b);
  }
453825
protected static boolean elementsEquals(Object e1, Object e2) {
		return (e1 == null && e2 == null) || e1.equals(e2);
	}
743315
public double distance(Synset synset1, Synset synset2) {
        Preconditions.checkNotNull(synset1);
        Preconditions.checkNotNull(synset2);
        if (synset1.equals(synset2)) {
            return 0d;
        }
        List<Synset> path = shortestPath(synset1, synset2);
        return path.isEmpty() ? Double.POSITIVE_INFINITY : path.size() - 1;
    }
128822
public static Double getDistanceBetweenCoordinates(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
        // sqrt( (x2-x1)^2 + (y2-y2)^2 )
        Double xDiff = point1._1() - point2._1();
        Double yDiff = point1._2() - point2._2();
        return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
    }
310050
public static double computeEarthMoverAbsoluteDistance(Map<String, Double> h1, Map<String, Double> h2) {
        Signature s1 = EarthMoverDistanceWrapper.histogramToSignature(h1);
        Signature s2 = EarthMoverDistanceWrapper.histogramToSignature(h2);

        return JFastEMD.distance(s1, s2, 0.0);
    }
876786
@Pure
	public double getDistanceBetweenBusHalts(int firsthaltIndex, int lasthaltIndex) {
		if (firsthaltIndex < 0 || firsthaltIndex >= this.validHalts.size() - 1) {
			throw new ArrayIndexOutOfBoundsException(firsthaltIndex);
		}
		if (lasthaltIndex <= firsthaltIndex || lasthaltIndex >= this.validHalts.size()) {
			throw new ArrayIndexOutOfBoundsException(lasthaltIndex);
		}

		double length = 0;

		final BusItineraryHalt b1 = this.validHalts.get(firsthaltIndex);
		final BusItineraryHalt b2 = this.validHalts.get(lasthaltIndex);
		final int firstSegment = b1.getRoadSegmentIndex();
		final int lastSegment = b2.getRoadSegmentIndex();

		for (int i = firstSegment + 1; i < lastSegment; ++i) {
			final RoadSegment segment = this.roadSegments.getRoadSegmentAt(i);
			length += segment.getLength();
		}

		Direction1D direction = getRoadSegmentDirection(firstSegment);
		if (direction.isRevertedSegmentDirection()) {
			length += b1.getPositionOnSegment();
		} else {
			length += this.roadSegments.getRoadSegmentAt(firstSegment).getLength() - b1.getPositionOnSegment();
		}

		direction = getRoadSegmentDirection(lastSegment);
		if (direction.isSegmentDirection()) {
			length += b2.getPositionOnSegment();
		} else {
			length += this.roadSegments.getRoadSegmentAt(firstSegment).getLength() - b2.getPositionOnSegment();
		}

		return length;
	}
507965
@Override
	public int compare(E o1, E o2) {
		return comparator.compare(o2, o1);
	}
654835
public static int getVertexCountAtDistance(IAtomContainer atomContainer, int distance) {
        int natom = atomContainer.getAtomCount();

        int[][] admat = AdjacencyMatrix.getMatrix(atomContainer);
        int[][] distanceMatrix = computeFloydAPSP(admat);

        int matches = 0;

        for (int i = 0; i < natom; i++) {
            for (int j = 0; j < natom; j++) {
                if (distanceMatrix[i][j] == distance) matches++;
            }
        }
        return matches / 2;
    }
366381
public static double distanceKms(BigDecimal lat1, BigDecimal lng1, BigDecimal lat2, BigDecimal lng2 ){
		return new GeoCoordinate(lat1, lng1).distanceTo(new GeoCoordinate(lat2, lng2));
	}
1250787
public static MotionDirection getHorizontalMotionDirection(MotionEvent e1, MotionEvent e2, float threshold) {
        float delta = getHorizontalMotionRawDelta(e1, e2);
        return getHorizontalMotionDirection(delta, threshold);
    }