proc_utils/proj.py
def haversine(p1, p2):
    """
    Calculate the great circle distance between two points
    on the earth (specified in decimal degrees)

    All args must be of equal length.
    # Points in lat lon order
    """
    p1, p2 = map(np.radians, [p1, p2])

    dlat = p1[0] - p2[0]
    dlon = p1[1] - p2[1]

    a = np.sin(dlat/2.0)**2 + np.cos(p1[0]) * np.cos(p2[0]) * np.sin(dlon/2.0)**2

    c = 2 * np.arcsin(np.sqrt(a))
    dist = 6371000 * c # [m]
    return dist

    Calculate the great circle distance between two points
    on the earth (specified in decimal degrees)

    All args must be of equal length.
    # Points in lat lon order
    
Calculate the great circle distance between two points
on the earth (specified in decimal degrees)

All args must be of equal length.
Points in lat lon order
Calculate the great circle distance between two points on the earth ( specified in decimal degrees ) All args must be of equal length . Points in lat lon order
def haversine(p1, p2):
    p1, p2 = map(np.radians, [p1, p2])
    dlat = p1[0] - p2[0]
    dlon = p1[1] - p2[1]
    a = np.sin(dlat/2.0)**2 + np.cos(p1[0]) * np.cos(p2[0]) * np.sin(dlon/2.0)**2
    c = 2 * np.arcsin(np.sqrt(a))
    dist = 6371000 * c 
    return dist
def haversine ( p1 , p2 ) : p1 , p2 = map ( np . radians , [ p1 , p2 ] ) dlat = p1 [ 0 ] - p2 [ 0 ] dlon = p1 [ 1 ] - p2 [ 1 ] a = np . sin ( dlat / 2.0 ) ** 2 + np . cos ( p1 [ 0 ] ) * np . cos ( p2 [ 0 ] ) * np . sin ( dlon / 2.0 ) ** 2 c = 2 * np . arcsin ( np . sqrt ( a ) ) dist = 6371000 * c return dist
Calculate the great circle distance between two points
on the earth (specified in decimal degrees)
Calculate the great circle distance between two points on the earth ( specified in decimal degrees )
"""
    Calculate the great circle distance between two points
    on the earth (specified in decimal degrees)

    All args must be of equal length.
    # Points in lat lon order
    """ # [m]
p1
p2