Compute the distance between two points

@param p1		the first point
@param p2		the second point
@return			the distance between the two points
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));
    }
503453
public static double euclidean(EuclideanCoordinate coord1, EuclideanCoordinate coord2) {
		int size = Math.min(coord1.dimensions(), coord2.dimensions());
		double distance = 0;
		for(int i = 0; i < size; i++) {
			double diff = coord1.get(i) - coord2.get(i);
			distance += diff * diff;
		}
		distance = Math.sqrt(distance);
		return distance;
	}
1066312
public static Integer distance(String h1, String h2) {
		HammingDistance distance = new HammingDistance();
		return distance.apply(h1, h2);
	}
1112107
public static double getDistance(double x1, double y1, double x2, double y2)
    {
        final double x = x2 - x1;
        final double y = y2 - y1;

        return StrictMath.sqrt(x * x + y * y);
    }
754125
public static Boolean areCoordinatesWithinThreshold(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
        return getDistanceBetweenCoordinates(point1, point2) < COORDINATE_THRESHOLD;
    }
876921
public static double distance(double lat1, double lon1,
                                double lat2, double lon2) {
    double dLat = Math.toRadians(lat2-lat1);
    double dLon = Math.toRadians(lon2-lon1);
    lat1 = Math.toRadians(lat1);
    lat2 = Math.toRadians(lat2);

    double a = Math.sin(dLat/2) * Math.sin(dLat/2) +
        Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); 
    double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
    return R * c;
  }
972639
public final double distance(E e1, E e2) {
    return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
  }
252351
public static double distanceBetween(double latitude1, double longitude1, double latitude2, double longitude2) {
        double dLat = toRadians(latitude2 - latitude1);
        double dLon = toRadians(longitude2 - longitude1);
        latitude1 = toRadians(latitude1);
        latitude2 = toRadians(latitude2);

        double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(latitude1) * Math.cos(latitude2);
        double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
        return EARTH_RADIUS * c;
    }
380367
public static int distance (int x1, int y1, int x2, int y2)
    {
        int dx = x1-x2, dy = y1-y2;
        return (int)Math.sqrt(dx*dx+dy*dy);
    }
998491
def distance_to_point2(self, p2: "Point2") -> Union[int, float]:
        
        return ((self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2) ** 0.5
192090
public FloatPoint Subtract(FloatPoint point1, FloatPoint point2) {
        FloatPoint result = new FloatPoint(point1);
        result.Subtract(point2);
        return result;
    }
72964
public double normalizedDistance(double[] point1, double[] point2) throws Exception {
    return Math.sqrt(distance2(point1, point2)) / point1.length;
  }
37241
public static double distanceSquared(Point p1, Point p2)
	{
		double x = p2.x - p1.x;
		double y = p2.y - p1.y;
		double z = p2.z - p1.z;
		return x * x + y * y + z * z;
	}
192177
public double distance(double p1, double p2) {
    double d = (p1 - p2) * (p1 - p2);
    return Math.sqrt(d);
  }
825417
public static float distance (float x1, float y1, float x2, float y2) {
        return FloatMath.sqrt(distanceSq(x1, y1, x2, y2));
    }
1181367
public static Double getDistanceWithinThresholdOfCoordinates(
            Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
        throw new NotImplementedError();
    }
1136801
public long distance2(int[] point1, int[] point2) throws Exception {
    if (point1.length == point2.length) {
      long sum = 0;
      for (int i = 0; i < point1.length; i++) {
        sum = sum + (point2[i] - point1[i]) * (point2[i] - point1[i]);
      }
      return sum;
    }
    else {
      throw new Exception("Exception in Euclidean distance: array lengths are not equal");
    }
  }