Gets the Squared Euclidean distance between two points.

@param x1 X1 axis coordinates.
@param y1 Y1 axis coordinates.
@param x2 X2 axis coordinates.
@param y2 Y2 axis coordinates.
@return The Squared euclidean distance between x and y.
181042
public static double SquaredEuclidean(double x1, double y1, double x2, double y2) {

        double dx = x2 - x1;
        double dy = y2 - y1;
        return dx * dx + dy * dy;

    }
721015
def _jit_pairwise_distances(pos1, pos2):
        
        n1 = pos1.shape[0]
        n2 = pos2.shape[0]
        D = np.empty((n1, n2))

        for i in range(n1):
            for j in range(n2):
                D[i, j] = np.sqrt(((pos1[i] - pos2[j])**2).sum())
        return D
780876
def l2_distance_sq(t1, t2, name=None):
  
  with tf.name_scope(name, 'l2_distance_sq', [t1, t2]) as scope:
    t1 = tf.convert_to_tensor(t1, name='t1')
    t2 = tf.convert_to_tensor(t2, name='t2')
    return length_squared(tf.subtract(t1, t2), name=scope)
879531
def min_square_dist(x_1, y_1, x_2, y_2):
    
    dist = np.zeros_like(x_1)
    for i in range(len(x_1)):
        dist[i] = np.min((x_1[i] - x_2)**2 + (y_1[i] - y_2)**2)
    return dist
247774
public double sqrMaxDistance(Envelope2D other) {
		if (isEmpty() || other.isEmpty())
			return NumberUtils.TheNaN;

		double dist = 0;
		Point2D[] points = new Point2D[4];
		queryCorners(points);
		Point2D[] points_o = new Point2D[4];
		other.queryCorners(points_o);
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 4; j++) {
				double d = Point2D.sqrDistance(points[i], points_o[j]);
				if (d > dist) {
					dist = d;
				}
			}
		}

		return dist;
	}
972639
public final double distance(E e1, E e2) {
    return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
  }
384893
public static double Cosine(double x1, double y1, double x2, double y2) {

        double sumProduct = x1 * x2 + y1 * y2;
        double sumP = Math.pow(Math.abs(x1), 2) + Math.pow(Math.abs(x2), 2);
        double sumQ = Math.pow(Math.abs(y1), 2) + Math.pow(Math.abs(y2), 2);
        sumP = Math.sqrt(sumP);
        sumQ = Math.sqrt(sumQ);

        double result = 1 - (sumProduct / (sumP * sumQ));
        return result;
    }
750339
@Pure
	public static Point2d L2_L1(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_2_N,
				LAMBERT_2_C,
				LAMBERT_2_XS,
				LAMBERT_2_YS);
		return NTFLambdaPhi_NTFLambert(
				ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
				LAMBERT_1_N,
				LAMBERT_1_C,
				LAMBERT_1_XS,
				LAMBERT_1_YS);
	}
639884
public double distanceFromCenter(final float x, final float y) {
        return Math.sqrt(Math.pow(x - this.x, 2) + Math.pow(y - this.y, 2));
    }
282495
def get_distance_between_two_points(self, one, two):
        """"""
        dx = one.x - two.x
        dy = one.y - two.y
        return math.sqrt(dx * dx + dy * dy)
1288241
public static <S extends Solution<?>> double distanceBetweenObjectives(S firstSolution, S secondSolution) {

    double diff;
    double distance = 0.0;

    //euclidean distance
    for (int nObj = 0; nObj < firstSolution.getNumberOfObjectives(); nObj++) {
      diff = firstSolution.getObjective(nObj) - secondSolution.getObjective(nObj);
      distance += Math.pow(diff, 2.0);
    }

    return Math.sqrt(distance);
  }
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);
    }
1356225
public static final double distance(Point p1, Point p2)
    {
        return Math.hypot(p1.getX() - p2.getX(), p1.getY() - p2.getY());
    }
1283049
public float euclideanDistance(LinearSparseVector sv) {
		float dist = 0.0f;
		int r = 0;
		for (int i = 0; i < sv.length; i++) {
			if (sv.index[i] == index[r]) {
				float cur = (float) data[r] - (float) sv.data[i];
				dist += cur * cur;
				r++;
			} else {
				float cur = (float) sv.data[i];
				dist += cur * cur;
			}
		}
		for (; r < length; r++) {
			float cur = (float) data[r];
			dist += cur * cur;
		}
		return dist;
	}
366599
def distance(self, point):
        
        return sqrt((self.x-point.x)**2+(self.y-point.y)**2)
1334992
@Override
  public double distance(NumberVector v1, NumberVector v2) {
    if(v1.getDimensionality() != v2.getDimensionality()) {
      throw new IllegalArgumentException("Different dimensionality of FeatureVectors\n  " + "first argument: " + v1 + "\n  " + "second argument: " + v2);
    }

    double sqrDist = 0;
    for(int d = BitsUtil.nextSetBit(dimensions, 0); d >= 0; d = BitsUtil.nextSetBit(dimensions, d + 1)) {
      final double delta = v1.doubleValue(d) - v2.doubleValue(d);
      sqrDist += delta * delta;
    }
    return FastMath.sqrt(sqrDist);
  }
654251
public static double distance(SparseArray x, SparseArray y) {
        return Math.sqrt(squaredDistance(x, y));
    }