Calculate distance in miles or kilometers between current and other
        passed point.
495911
def distance_to(self, point, unit='km'):
        
        assert isinstance(point, GeoPoint), (
            'Other point should also be a Point instance.'
        )
        if self == point:
            return 0.0
        coefficient = 69.09
        theta = self.longitude - point.longitude
        unit = unit.lower() if unit else None

        distance = math.degrees(math.acos(
            math.sin(self.rad_latitude) * math.sin(point.rad_latitude) +
            math.cos(self.rad_latitude) * math.cos(point.rad_latitude) *
            math.cos(math.radians(theta))
        )) * coefficient

        if unit == 'km':
            return utils.mi_to_km(distance)

        return distance
832829
def distanceFromPoint(self, point):
        '''
        
        '''
        # XXX planar distance, doesn't take into account z ?
        d = self.m
        n = (d.y * point.x) - (d.x * point.y) + self.A.cross(self.B)
        return abs(n / self.A.distance(self.B))
1189867
def Y_dist(self, new_y_distance):
        """"""
        self.parent.value('y_distance', new_y_distance)
        self.parent.traces.display()
724013
def distance(self, other):
        
        return distance((self.separation, self.pa), (other.separation, other.pa))
366599
def distance(self, point):
        
        return sqrt((self.x-point.x)**2+(self.y-point.y)**2)
342394
public double distance(int[] point1, int[] point2) throws Exception {
    return Math.sqrt(Long.valueOf(distance2(point1, point2)).doubleValue());
  }
87409
def distance_to_point(x, y, z)
      a*x + b*y + c*z - d
    end
711384
def _distance(coord1, coord2):
    
    xdist = coord1[0] - coord2[0]
    ydist = coord1[1] - coord2[1]
    return sqrt(xdist*xdist + ydist*ydist)
1349152
def _distance(self, x0, y0, x1, y1):
        """"""
        dx = x1-x0
        dy = y1-y0
        # roll displacements across the borders
        if self.pix:
            dx[ dx > self.Lx/2 ] -= self.Lx
            dx[ dx < -self.Lx/2 ] += self.Lx
        if self.piy:
            dy[ dy > self.Ly/2 ] -= self.Ly
            dy[ dy < -self.Ly/2 ] += self.Ly
        return dx, dy
937889
def distancePointToLine(point, line_start, line_end, perpendicular=False):
    """"""
    p1 = line_start
    p2 = line_end
    offset = lineOffsetWithMinimumDistanceToPoint(
        point, line_start, line_end, perpendicular)
    if offset == INVALID_DISTANCE:
        return INVALID_DISTANCE
    if offset == 0:
        return distance(point, p1)
    u = offset / distance(line_start, line_end)
    intersection = (p1[0] + u * (p2[0] - p1[0]), p1[1] + u * (p2[1] - p1[1]))
    return distance(point, intersection)
345736
def _distance(self):
        """"""
        return np.average(self.min_kl, weights=self.f.weights)
614774
def distance(self, there):
        
        return haversine_distance((self.latitude, self.longitude),
                                  (there.latitude, there.longitude))
998491
def distance_to_point2(self, p2: "Point2") -> Union[int, float]:
        
        return ((self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2) ** 0.5
969682
function calculateTouchesDistance(startPoint, endPoint) {
			var diffX = Math.abs(startPoint.x - endPoint.x);
			var diffY = Math.abs(startPoint.y - endPoint.y);
				
			return Math.round(Math.sqrt(diffX*diffX+diffY*diffY));
		}
306789
def distance_tt_point(a, b):
    
    return math.sqrt((b.lat-a.lat)**2 + (b.lon-a.lon)**2)
590275
function(points, callback, fromIndex, toIndex) {
	var i, len, index, currentDistance, currentSpeed, fastestSpeed = 0, slowestSpeed = 100000000;
	var result;
	len = points.length - 1;
	i = 0;
	if(fromIndex && fromIndex > 0 && fromIndex < len) {
		i = fromIndex;
	}
	if(toIndex && toIndex < len) {
		len = toIndex;
	}
	if(points.length < 2 || len - i < 2) {
		return callback(new Error('Result can not be calculated properly with data points less than 2'), null);
	}

	try {
		result = new TrackingResult();
		index = 0;
		result.points[index] = Trackpoint.copy(points[i]);
		result.points[index].distance = 0;
		for(; i < len; i++, index++) {
			result.points[index + 1] = Trackpoint.copy(points[i + 1]);
			currentDistance = distance.getDistance(result.points[index].lng, result.points[index].lat, result.points[index + 1].lng, result.points[index + 1].lat);
			currentSpeed = speed.calculateSpeed(currentDistance, result.points[index].time, result.points[index + 1].time);
			result.totalDistance += currentDistance;
			result.points[index + 1].distance = result.points[index].distance + currentDistance;
			result.points[index + 1].speed = currentSpeed;
			if(currentSpeed > fastestSpeed) {
				fastestSpeed = currentSpeed;
			}
			if(currentSpeed < slowestSpeed) {
				slowestSpeed = currentSpeed;
			}
		}
		result.points[0].speed = result.points[1].speed;
		result.averageSpeed = speed.calculateSpeed(result.totalDistance, result.points[0].time, result.points[index].time);
		result.fastestSpeed = fastestSpeed;
		result.slowestSpeed = slowestSpeed;
		result.totalTime = time.getDiffInSecs(result.points[0].time, result.points[index].time);
		callback(null, result);
	} catch(e) {
		callback(e, null);
	}
}
1204691
def geo_distance(a, b):
    """"""
    a_y = radians(a.y)
    b_y = radians(b.y)
    delta_x = radians(a.x - b.x)
    cos_x = (sin(a_y) * sin(b_y) +
             cos(a_y) * cos(b_y) * cos(delta_x))
    return acos(cos_x) * earth_radius_km