Calculates the Euclidean distance between two points.

@param point1 The first point.
@param point2 The second point.
@return The Euclidean distance.
@throws Exception In the case of error.
342394
public double distance(int[] point1, int[] point2) throws Exception {
    return Math.sqrt(Long.valueOf(distance2(point1, point2)).doubleValue());
  }
224597
public static final double distance(final Point2D a, final Point2D b)
    {
        return Point2DJSO.distance(a.getJSO(), b.getJSO());
    }
998491
def distance_to_point2(self, p2: "Point2") -> Union[int, float]:
        
        return ((self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2) ** 0.5
1039939
@Pure
	public static boolean epsilonEqualsDistance(double value1, double value2) {
		return value1 >= (value2 - distancePrecision) && value1 <= (value2 + distancePrecision);
	}
1171833
public FloatPoint Multiply(FloatPoint point1, FloatPoint point2) {
        FloatPoint result = new FloatPoint(point1);
        result.Multiply(point2);
        return result;
    }
972639
public final double distance(E e1, E e2) {
    return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
  }
1365462
public static double distance(DLocation p1, DLocation p2) {
		double p1lat = Math.toRadians(p1.getLatitude());
		double p1lon = Math.toRadians(p1.getLongitude());
		double p2lat = Math.toRadians(p2.getLatitude());
		double p2lon = Math.toRadians(p2.getLongitude());
		return distance(p1lat, p1lon, p2lat, p2lon);
	}
521795
public double distance(double[] v1, double[] v2) {
    final int dim1 = v1.length, dim2 = v2.length;
    final int mindim = dim1 < dim2 ? dim1 : dim2;
    double agg = preDistance(v1, v2, 0, mindim);
    if(dim1 > mindim) {
      agg += preNorm(v1, mindim, dim1);
    }
    else if(dim2 > mindim) {
      agg += preNorm(v2, mindim, dim2);
    }
    return agg;
  }
480352
public int compare(Point2D other) {
		return y < other.y ? -1 : (y > other.y ? 1 : (x < other.x ? -1
				: (x > other.x ? 1 : 0)));
	}
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;
  }
264680
private static double getSqDist(Point p1, Point p2) {
    double dx = p1.longitude() - p2.longitude();
    double dy = p1.latitude() - p2.latitude();
    return dx * dx + dy * dy;
  }
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;
    }
1209999
public static double euclidean(AssociativeArray a1, AssociativeArray a2) {
        Map<Object, Double> columnDistances = columnDistances(a1, a2, null);
        
        double distance = 0.0;
        for(double columnDistance : columnDistances.values()) {
            distance+=(columnDistance*columnDistance);
        }
        
        return Math.sqrt(distance);
    }
1133138
def _distance_squared(self, p2: "Point2") -> Union[int, float]:
        
        return (self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2
1229406
public float distance(INDArray arr1, INDArray arr2) {
        if (scalars == null)
            scalars = new ThreadLocal<>();

        if (Nd4j.scalar(0.0f).equals(scalars.get()))
            scalars.set(Nd4j.scalar(0.0));

        switch (similarityFunction) {
            case "jaccard":
                float ret7 = Nd4j.getExecutioner()
                        .execAndReturn(new JaccardDistance(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret7 : ret7;
            case "hamming":
                float ret8 = Nd4j.getExecutioner()
                        .execAndReturn(new HammingDistance(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret8 : ret8;
            case "euclidean":
                float ret = Nd4j.getExecutioner()
                        .execAndReturn(new EuclideanDistance(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret : ret;
            case "cosinesimilarity":
                float ret2 = Nd4j.getExecutioner()
                        .execAndReturn(new CosineSimilarity(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret2 : ret2;
            case "cosinedistance":
                float ret6 = Nd4j.getExecutioner()
                        .execAndReturn(new CosineDistance(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret6 : ret6;
            case "manhattan":
                float ret3 = Nd4j.getExecutioner()
                        .execAndReturn(new ManhattanDistance(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret3 : ret3;
            case "dot":
                float dotRet = (float) Nd4j.getBlasWrapper().dot(arr1, arr2);
                return invert ? -dotRet : dotRet;
            default:
                float ret4 = Nd4j.getExecutioner()
                        .execAndReturn(new EuclideanDistance(arr1, arr2, scalars.get()))
                        .getFinalResult().floatValue();
                return invert ? -ret4 : ret4;

        }
    }
540536
public double seriesDistance(double[][] series1, double[][] series2) throws Exception {
    if (series1.length == series2.length) {
      Double res = 0D;
      for (int i = 0; i < series1.length; i++) {
        res = res + distance2(series1[i], series2[i]);
      }
      return Math.sqrt(res);
    }
    else {
      throw new Exception("Exception in Euclidean distance: array lengths are not equal");
    }
  }
1115176
public double distance(Vector2D vector2d) {
		double a = vector2d.x - x;
		double b = vector2d.y - y;
		return Math.sqrt(a * a + b * b);
	}