





from math import atan, cos, radians, sin, tan

from .haversine_distance import haversine_distance

UpperCAmelCase__						:			Optional[Any]									=6_37_81_37.0
UpperCAmelCase__						:			Any									=6_35_67_52.31_42_45
UpperCAmelCase__						:			Optional[int]									=6_37_81_37





def      _lowercase					(						_UpperCAmelCase			,      _UpperCAmelCase			,      _UpperCAmelCase			,      _UpperCAmelCase				)						->  float:
    lowerCamelCase	 =(AXIS_A - AXIS_B) / AXIS_A
    # Parametric latitudes
    # https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
    lowerCamelCase	 =atan((1 - flattening) * tan(radians(_UpperCAmelCase				)				)				)
    lowerCamelCase	 =atan((1 - flattening) * tan(radians(_UpperCAmelCase				)				)				)

    # Compute central angle between two points
    # using haversine theta. sigma =  haversine_distance / equatorial radius
    lowerCamelCase	 =haversine_distance(_UpperCAmelCase			,      _UpperCAmelCase			,      _UpperCAmelCase			,      _UpperCAmelCase				) / EQUATORIAL_RADIUS

    # Intermediate P and Q values
    lowerCamelCase	 =(b_lata + b_lata) / 2
    lowerCamelCase	 =(b_lata - b_lata) / 2

    # Intermediate X value
    # X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
    lowerCamelCase	 =(sin(_UpperCAmelCase				) ** 2) * (cos(_UpperCAmelCase				) ** 2)
    lowerCamelCase	 =cos(sigma / 2				) ** 2
    lowerCamelCase	 =(sigma - sin(_UpperCAmelCase				)) * (x_numerator / x_demonimator)

    # Intermediate Y value
    # Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
    lowerCamelCase	 =(cos(_UpperCAmelCase				) ** 2) * (sin(_UpperCAmelCase				) ** 2)
    lowerCamelCase	 =sin(sigma / 2				) ** 2
    lowerCamelCase	 =(sigma + sin(_UpperCAmelCase				)) * (y_numerator / y_denominator)

    return EQUATORIAL_RADIUS * (sigma - ((flattening / 2) * (x_value + y_value)))


if __name__ == "__main__":
       import doctest

       doctest.testmod()












from abc import ABC, abstractmethod
from argparse import ArgumentParser

class       __A     (						a    ):


				@staticmethod
				@abstractmethod
				def _snake_case       (		UpperCAmelCase_							):
								raise NotImplementedError()


				@abstractmethod
				def _snake_case       (		self							):
								raise NotImplementedError()





