def course(p0, p1, deg=True, bearing=False):
    single, (p0, p1) = _to_arrays((p0, 2), (p1, 2))
    if deg:
        p0 = np.radians(p0)
        p1 = np.radians(p1)

    lon0, lat0 = p0[:,0], p0[:,1]
    lon1, lat1 = p1[:,0], p1[:,1]

    dlon = lon1 - lon0
    a = sin(dlon) * cos(lat1)
    b = cos(lat0) * sin(lat1) - sin(lat0) * cos(lat1) * cos(dlon)

    if bearing:
        angle = arctan2(a, b)
    else:
        angle = arctan2(b, a)

    if deg:
        angle = np.degrees(angle)

    if single:
        angle = angle[0]

    return angle
Unittest Runner
dataset/ETHPy150Open jwass/geog/geog/geog.py/course--crossover with--dataset/ETHPy150Open ioflo/ioflo/ioflo/aio/udp/test/test_udping.py/runOne