Beispiel #1
0
def compute_curved_earth_correction(wgs84_lat1, wgs84_long1, wgs84_lat2, wgs84_long2, latitudes, longitudes):
    """
    Compute the curved earth correction with the given parameters.

    :param wgs84_lat1: the latitude of the starting point
    :param wgs84_long1: the longitude of the starting point
    :param wgs84_lat2: the latitude of the ending point
    :param wgs84_long2: the longitude of the ending point
    :param latitudes: latitudes of the points to compute the correction at
    :param longitudes: longitudes of the points to compute the correction at
    :return:
    """
    half_central_angle = geometry.half_central_angle(math.radians(wgs84_lat1), math.radians(wgs84_long1),
                                                     math.radians(wgs84_lat2), math.radians(wgs84_long2))
    max_overhead = geometry.overhead_height(half_central_angle, geometry.EARTH_RADIUS)
    angles = geometry.central_angle(np.deg2rad(wgs84_lat1), np.deg2rad(wgs84_long1), np.deg2rad(latitudes),
                                             np.deg2rad(longitudes))
    return max_overhead - geometry.overhead_height(half_central_angle - angles, geometry.EARTH_RADIUS)
Beispiel #2
0
def test_overhead_height():
    expected = 2.731679321737121
    actual = geometry.overhead_height(0.00092629, geometry.EARTH_RADIUS)
    assert abs(expected - actual) <= EPSILON
Beispiel #3
0
def test_overhead_height():
    expected = 2.731679321737121
    actual = geometry.overhead_height(0.00092629, geometry.EARTH_RADIUS)
    assert abs(expected - actual) <= EPSILON