Distance to some other point.
336605
def dist(self, other):
    """"""
    dx = self.x - other.x
    dy = self.y - other.y
    return math.sqrt(dx**2 + dy**2)
388994
def fast_distance(r1: 'Region', r2: 'Region'):
        
        return abs(r1.x - r2.x) + abs(r1.y - r2.y)
935123
def pointIsBetween(startP, endP, p):
    
    return (distancePoint(startP, p) + distancePoint(p, endP)
            - distancePoint(startP, endP) < 1e-6)
1069258
public static int distanceSq (int x0, int y0, int x1, int y1)
    {
        return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0));
    }
758609
def eol_distance_last(self, offset=0):
        """"""
        distance = 0
        for char in reversed(self.string[:self.pos + offset]):
            if char == '\n':
                break
            else:
                distance += 1
        return distance
380256
def distance_to(self, other):
        
        if self.overlaps(other):
            return 0
        try:
            if self.begin < other.begin:
                return other.begin - self.end
            else:
                return self.begin - other.end
        except:
            if self.end <= other:
                return other - self.end
            else:
                return self.begin - other
510850
def point_line_distance(point, start, end):
    
    if start == end:
        return distance(point, start)
    else:
        un_dist = abs(
            (end.lat-start.lat)*(start.lon-point.lon) - (start.lat-point.lat)*(end.lon-start.lon)
        )
        n_dist = sqrt(
            (end.lat-start.lat)**2 + (end.lon-start.lon)**2
        )
        if n_dist == 0:
            return 0
        else:
            return un_dist / n_dist
127479
private float distance(MotionEvent event) {
        if (event.getPointerCount() < 2) {
            return 0;
        }
        return PointF.length(event.getX(POINTER1) - event.getX(POINTER2), //
                event.getY(POINTER1) - event.getY(POINTER2));
    }
1029108
def distance(self, other):
        ''''''
        if self & other:
            return 0
        return numpy.max([other.left-self.right, self.left-other.right])
1108552
def distance(line, point):
    
    x0, y0, x1, y1 = line
    try:
        p1, p2 = point
    except ValueError:
        # line is given instead of point
        p1, p2 = middle(point)
    n1 = ascent(line)
    n2 = -1
    n0 = y0 - n1 * x0
    return abs(n1 * p1 + n2 * p2 + n0) / (n1 ** 2 + n2 ** 2) ** 0.5
306789
def distance_tt_point(a, b):
    
    return math.sqrt((b.lat-a.lat)**2 + (b.lon-a.lon)**2)
1270277
def distance_to_point(self, point):
        
        return np.abs(np.dot(self.normal_vector, point) + self.d)
216524
function getDistance(a, b) {
        var x, y;
        x = a.left - b.left;
        y = a.top - b.top;
        return Math.sqrt(x * x + y * y);
    }
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")
36720
public float distance2(float tx, float ty) {
		float dx = tx - px;
		float dy = ty - py;
		
		return ((dx*dx) + (dy*dy));
	}
1136711
def distance other, units = :km
        o = Itudes.new other
        raise ArgumentError.new "operand must be lat-/longitudable" if (o.latitude.nil? || o.longitude.nil?)

        dlat = Itudes.radians(o.latitude - @latitude)
        dlon = Itudes.radians(o.longitude - @longitude)
        lat1 = Itudes.radians(@latitude)
        lat2 = Itudes.radians(o.latitude);

        a = Math::sin(dlat/2)**2 + Math::sin(dlon/2)**2 * Math::cos(lat1) * Math::cos(lat2)
        (RADIUS[units] * 2.0 * Math::atan2(Math.sqrt(a), Math.sqrt(1-a))).abs
      end
779318
def Distance(lat1, lon1, lat2, lon2):
    """"""

    az12, az21, dist = wgs84_geod.inv(lon1, lat1, lon2, lat2)
    return az21, dist