distance between two points
338943
def distance_two(GPS_RAW1, GPS_RAW2, horizontal=True):
    ''''''
    if hasattr(GPS_RAW1, 'Lat'):
        lat1 = radians(GPS_RAW1.Lat)
        lat2 = radians(GPS_RAW2.Lat)
        lon1 = radians(GPS_RAW1.Lng)
        lon2 = radians(GPS_RAW2.Lng)
        alt1 = GPS_RAW1.Alt
        alt2 = GPS_RAW2.Alt
    elif hasattr(GPS_RAW1, 'cog'):
        lat1 = radians(GPS_RAW1.lat)*1.0e-7
        lat2 = radians(GPS_RAW2.lat)*1.0e-7
        lon1 = radians(GPS_RAW1.lon)*1.0e-7
        lon2 = radians(GPS_RAW2.lon)*1.0e-7
        alt1 = GPS_RAW1.alt*0.001
        alt2 = GPS_RAW2.alt*0.001
    else:
        lat1 = radians(GPS_RAW1.lat)
        lat2 = radians(GPS_RAW2.lat)
        lon1 = radians(GPS_RAW1.lon)
        lon2 = radians(GPS_RAW2.lon)
        alt1 = GPS_RAW1.alt*0.001
        alt2 = GPS_RAW2.alt*0.001
    dLat = lat2 - lat1
    dLon = lon2 - lon1

    a = sin(0.5*dLat)**2 + sin(0.5*dLon)**2 * cos(lat1) * cos(lat2)
    c = 2.0 * atan2(sqrt(a), sqrt(1.0-a))
    ground_dist = 6371 * 1000 * c
    if horizontal:
        return ground_dist
    return sqrt(ground_dist**2 + (alt2-alt1)**2)
1318863
function getDistance(p1, p2, props) {
  if (!props) {
    props = PROPS_XY;
  }
  var x = p2[props[0]] - p1[props[0]];
  var y = p2[props[1]] - p1[props[1]];

  return Math.sqrt((x * x) + (y * y));
}
276917
def distance(latitude_1, longitude_1, elevation_1, latitude_2, longitude_2, elevation_2,
             haversine=None):
    

    # If points too distant -- compute haversine distance:
    if haversine or (abs(latitude_1 - latitude_2) > .2 or abs(longitude_1 - longitude_2) > .2):
        return haversine_distance(latitude_1, longitude_1, latitude_2, longitude_2)

    coef = math.cos(latitude_1 / 180. * math.pi)
    #pylint: disable=invalid-name
    x = latitude_1 - latitude_2
    y = (longitude_1 - longitude_2) * coef

    distance_2d = math.sqrt(x * x + y * y) * ONE_DEGREE

    if elevation_1 is None or elevation_2 is None or elevation_1 == elevation_2:
        return distance_2d

    return math.sqrt(distance_2d ** 2 + (elevation_1 - elevation_2) ** 2)
998491
def distance_to_point2(self, p2: "Point2") -> Union[int, float]:
        
        return ((self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2) ** 0.5
1029108
def distance(self, other):
        ''''''
        if self & other:
            return 0
        return numpy.max([other.left-self.right, self.left-other.right])
852425
public static float distance (Point source, Point dest)
    {
        return MathUtil.distance(source.x, source.y, dest.x, dest.y);
    }
342394
public double distance(int[] point1, int[] point2) throws Exception {
    return Math.sqrt(Long.valueOf(distance2(point1, point2)).doubleValue());
  }
722820
public double distance(Object pt1, Object pt2) {
		Object p = newCopy(pt1);
		subtract(p, pt2);
		return magnitude(p);
	}
706237
def distance(coordinates)
      coordinates = coordinates.center if coordinates.respond_to?(:center)
      Math.sqrt([center, coordinates].transpose.map {|a,b| (b - a)**2}.reduce {|d1,d2| d1 + d2})
    end
207673
public static double distance(double[] pointA, double[] pointB, int offsetB) {
		return Math.sqrt(distanceSquared(pointA, pointB, offsetB));
	}
87409
def distance_to_point(x, y, z)
      a*x + b*y + c*z - d
    end
126617
def path_distance(points):
    
    vecs = np.diff(points, axis=0)[:, :3]
    d2 = [np.dot(p, p) for p in vecs]
    return np.sum(np.sqrt(d2))
128822
public static Double getDistanceBetweenCoordinates(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
        // sqrt( (x2-x1)^2 + (y2-y2)^2 )
        Double xDiff = point1._1() - point2._1();
        Double yDiff = point1._2() - point2._2();
        return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
    }
850145
def distance(self, x, y):
        
        if scipy.sparse.issparse(x):
            return numpy.sum(numpy.absolute((x-y).toarray().ravel()))
        else:
            return numpy.sum(numpy.absolute(x-y))
803346
def distances(self, points):
        """"""
        return [math.acos(self._pos3d.dot(p.vector)) for p in points]
1258246
public int getManhattanDistance(Point2 that) {
    return Math.abs(x - that.x) + Math.abs(y - that.y);
  }
590313
@Pure
	public double distance(Point2D<?, ?> point) {
		assert point != null;
		final GeoLocationPoint p = getGeoPosition();
		if (p != null) {
			return Point2D.getDistancePointPoint(p.getX(), p.getY(), point.getX(), point.getY());
		}
		return Double.NaN;
	}