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)
def test_central_angle(): expected = 0.003366084793899 actual = geometry.central_angle(0.76029552909832, 0.0252164472196439, 0.76220881138424, 0.0213910869250003) assert abs(expected - actual) <= EPSILON_L