How to use the pymap3d.vincenty.vreckon function in pymap3d

To help you get started, we’ve selected a few pymap3d examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scivision / pymap3d / tests / test_vincenty_vreckon.py View on Github external
def test_unit(lat, lon, srange, az, lato, lono):
    lat1, lon1 = vincenty.vreckon(lat, lon, srange, az)

    assert lat1 == approx(lato)
    assert lon1 == approx(lono, rel=0.001)
github scivision / pymap3d / tests / test_vincenty_vreckon.py View on Github external
def test_az_vector():
    pytest.importorskip("numpy")
    a, b = vincenty.vreckon(*ll0, sr1[0], az1)
    assert a == approx(lat2)
    assert b == approx(lon2)
github scivision / pymap3d / tests / test_vincenty_vreckon.py View on Github external
def test_both_vector():
    pytest.importorskip("numpy")
    a, b = vincenty.vreckon(10, 20, sr1, az1)
    assert a == approx(lat3)
    assert b == approx(lon3)
github scivision / pymap3d / tests / test_vincenty_dist.py View on Github external
def test_identity(lat, lon, slantrange, az):
    lat1, lon1 = vincenty.vreckon(lat, lon, slantrange, az)

    dist, az1 = vincenty.vdist(lat, lon, lat1, lon1)

    assert dist == approx(slantrange)
    assert az1 == approx(az)
github scivision / pymap3d / tests / benchmark_vincenty.py View on Github external
def bench_vreckon(N: int) -> float:

    sr = np.random.random(N)
    az = np.random.random(N)

    tic = time.monotonic()
    a, b = vreckon(*ll0, sr, az)

    return time.monotonic() - tic
github scivision / pymap3d / examples / vreckon.py View on Github external
def main():
    p = ArgumentParser(description="Given starting latitude, longitude: find final lat,lon for distance and azimuth")
    p.add_argument("lat", help="latitude WGS-84 [degrees]", type=float)
    p.add_argument("lon", help="longitude WGS-84 [degrees]", type=float)
    p.add_argument("range", help="range from start point [meters]", type=float)
    p.add_argument("azimuth", help="clockwise from north: azimuth to start [degrees]", type=float)
    P = p.parse_args()

    lat2, lon2 = vreckon(P.lat, P.lon, P.range, P.azimuth)

    print("lat, lon = ({:.4f}, {:.4f})".format(lat2, lon2))