




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

from .haversine_distance import haversine_distance

UpperCamelCase__         =      6378137.0
UpperCamelCase__         =      6356752.314245
UpperCamelCase__         =      6378137







def      _a				(						SCREAMING_SNAKE_CASE_							:    float				,				SCREAMING_SNAKE_CASE_							:    float				,				SCREAMING_SNAKE_CASE_							:    float				,				SCREAMING_SNAKE_CASE_							:    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(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()










def      _a				(						SCREAMING_SNAKE_CASE_							:    List[Any]					):
					__lowerCAmelCase       ,							__lowerCAmelCase           =	[], []
					while len(SCREAMING_SNAKE_CASE_					) > 1:
										__lowerCAmelCase       ,							__lowerCAmelCase           =	min(SCREAMING_SNAKE_CASE_					), max(SCREAMING_SNAKE_CASE_					)
										start.append(SCREAMING_SNAKE_CASE_					)
										end.append(SCREAMING_SNAKE_CASE_					)
										collection.remove(SCREAMING_SNAKE_CASE_					)
										collection.remove(SCREAMING_SNAKE_CASE_					)
					end.reverse()
					return start + collection + end


if __name__ == "__main__":
					UpperCamelCase__         =      input("""Enter numbers separated by a comma:\n""").strip()
					UpperCamelCase__         =      [int(item) for item in user_input.split(""",""")]
					print(*merge_sort(unsorted), sep=""",""")




