




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

from .haversine_distance import haversine_distance

UpperCamelCase								=					637_8137.0
UpperCamelCase								=					635_6752.31_4245
UpperCamelCase								=					637_8137



def 							_A       (						lowerCAmelCase_					: float       ,    lowerCAmelCase_					: float       ,    lowerCAmelCase_					: float       ,    lowerCAmelCase_					: float      ):
     """simple docstring"""

     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(SCREAMING_SNAKE_CASE_      )      )      )
     lowerCAmelCase__          =			atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE_      )      )      )

     # Compute central angle between two points
     # using haversine theta. sigma =  haversine_distance / equatorial radius
     lowerCAmelCase__          =			haversine_distance(SCREAMING_SNAKE_CASE_       ,    SCREAMING_SNAKE_CASE_       ,    SCREAMING_SNAKE_CASE_       ,    SCREAMING_SNAKE_CASE_      ) / 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(SCREAMING_SNAKE_CASE_      ) ** 2) * (cos(SCREAMING_SNAKE_CASE_      ) ** 2)
     lowerCAmelCase__          =			cos(sigma / 2      ) ** 2
     lowerCAmelCase__          =			(sigma - sin(SCREAMING_SNAKE_CASE_      )) * (x_numerator / x_demonimator)

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

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


if __name__ == "__main__":
     import doctest

     doctest.testmod()






from statistics import mean, stdev



def 							_A       (						lowerCAmelCase_					: list       ,    lowerCAmelCase_					: int = 3      ):
     """simple docstring"""

     lowerCAmelCase__          =			min(lowerCAmelCase_      )
     lowerCAmelCase__          =			max(lowerCAmelCase_      )
     # normalize data
     return [round((x - x_min) / (x_max - x_min)       ,    lowerCAmelCase_      ) for x in data]






def 							_A       (						lowerCAmelCase_					: list       ,    lowerCAmelCase_					: int = 3      ):
     """simple docstring"""

     lowerCAmelCase__          =			mean(lowerCAmelCase_      )
     lowerCAmelCase__          =			stdev(lowerCAmelCase_      )
     # standardize data
     return [round((x - mu) / (sigma)       ,    lowerCAmelCase_      ) for x in data]
