Computes distance measure between vectors x and y. Returns float.
552392
def distance(self, x, y):
        

        if scipy.sparse.issparse(x):
            x = x.toarray().ravel()
            y = y.toarray().ravel()
        return 1.0 - numpy.dot(x, y)
711384
def _distance(coord1, coord2):
    
    xdist = coord1[0] - coord2[0]
    ydist = coord1[1] - coord2[1]
    return sqrt(xdist*xdist + ydist*ydist)
1166382
def _compute_distance(self, rup, dists, C):
        
        rval = np.sqrt(dists.repi ** 2 + C['h'] ** 2)
        return C['c1'] * np.log10(rval)
673384
public static float distance (int x0, int y0, int x1, int y1)
    {
        return (float)Math.sqrt(((x1 - x0) * (x1 - x0)) +
                                ((y1 - y0) * (y1 - y0)));
    }
395842
def distance(self, other):
        
        return np.linalg.norm(other.coords - self.coords)
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);
    }
597127
def distance(vec1, vec2):
        """"""
        if isinstance(vec1, Vector2) \
                and isinstance(vec2, Vector2):
            dist_vec = vec2 - vec1
            return dist_vec.length()
        else:
            raise TypeError("vec1 and vec2 must be Vector2's")
1069258
public static int distanceSq (int x0, int y0, int x1, int y1)
    {
        return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0));
    }
503815
def unit_vector(self):
        """"""
        return Point2D( self.x / self.magnitude, self.y / self.magnitude )
619283
public static float distance(final float ax, final float ay,
                                 final float bx, final float by) {
        return (float) Math.sqrt(
                (ax - bx) * (ax - bx) +
                        (ay - by) * (ay - by)
        );
    }
10171
public float distanceSquared(Vector2f other) {
		float dx = other.getX() - getX();
		float dy = other.getY() - getY();
		
		return (float) (dx*dx)+(dy*dy);
	}
84778
def distance_to(self, other):
        """"""

        other_coord = self._arith_check(other)
        return math.sqrt(math.pow(self._x - other_coord._x, 2) +
                         math.pow(self._y - other_coord._y, 2))
337614
def distance_measure_common(A, func, alpha, R, k, epsilon):
    """"""
    # create test vectors
    x = relaxation_vectors(A, R, k, alpha)

    # apply distance measure function to vectors
    d = func(x)

    # drop distances to self
    (rows, cols) = A.nonzero()
    weak = np.where(rows == cols)[0]
    d[weak] = 0
    C = sparse.csr_matrix((d, (rows, cols)), shape=A.shape)
    C.eliminate_zeros()

    # remove weak connections
    # removes entry e from a row if e > theta * min of all entries in the row
    amg_core.apply_distance_filter(C.shape[0], epsilon, C.indptr,
                                   C.indices, C.data)
    C.eliminate_zeros()

    # Standardized strength values require small values be weak and large
    # values be strong.  So, we invert the distances.
    C.data = 1.0 / C.data

    # Put an identity on the diagonal
    C = C + sparse.eye(C.shape[0], C.shape[1], format='csr')

    # Scale C by the largest magnitude entry in each row
    C = scale_rows_by_largest_entry(C)

    return C
50043
function distanceSquared(a, b) {
    const diff = {
        x: a.x - b.x,
        y: a.y - b.y,
    };

    return dotProduct(diff, diff);
}
157065
public static int distanceSq (int x1, int y1, int x2, int y2) {
        x2 -= x1;
        y2 -= y1;
        return x2 * x2 + y2 * y2;
    }
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));
    }
737523
def get_distance_matrix(x):
    """"""
    square = nd.sum(x ** 2.0, axis=1, keepdims=True)
    distance_square = square + square.transpose() - (2.0 * nd.dot(x, x.transpose()))
    return nd.sqrt(distance_square)