
"""simple docstring"""





import copy
import re



class __lowerCAmelCase				:




			"""simple docstring"""







			snake_case	      =				"hp"
			snake_case	      =				{}
			snake_case	      =				None




			@classmethod
			def      lowerCamelCase__     (				cls						:					List[str]       ,   _snake_case						:					Tuple       ,   _snake_case						:					Tuple	)      -> List[Any]:







								"""simple docstring"""
								A_				 =						prefix
								A_				 =						defaults
								cls.build_naming_info()




			@staticmethod
			def      lowerCamelCase__     (				_snake_case						:					Union[str, Any]       ,   _snake_case						:					Tuple	)      -> Dict:







								"""simple docstring"""
								if len(_snake_case	) == 0:
													return ""
								A_				 =						None
								if any(char.isdigit() for char in word	):
													raise Exception(F'Parameters should not contain numbers: \'{word}\' contains a number'	)
								if word in info["short_word"]:
													return info["short_word"][word]
								for prefix_len in range(1       ,   len(_snake_case	) + 1	):
													A_				 =						word[:prefix_len]
													if prefix in info["reverse_short_word"]:
																		continue
													else:
																		A_				 =						prefix
																		break

								if short_word is None:
													# Paranoid fallback
													def int_to_alphabetic(_snake_case						:					Optional[Any]	):
																		A_				 =						""
																		while integer != 0:
																							A_				 =						chr(ord("A"	) + integer % 10	) + s
																							integer //= 10
																		return s

													A_				 =						0
													while True:
																		A_				 =						word + "#" + int_to_alphabetic(_snake_case	)
																		if sword in info["reverse_short_word"]:
																							continue
																		else:
																							A_				 =						sword
																							break

								A_				 =						short_word
								A_				 =						word
								return short_word




			@staticmethod
			def      lowerCamelCase__     (				_snake_case						:					Union[str, Any]       ,   _snake_case						:					int	)      -> Tuple:







								"""simple docstring"""
								A_				 =						param_name.split("_"	)

								A_				 =						[TrialShortNamer.shortname_for_word(_snake_case       ,   _snake_case	) for word in words]

								# We try to create a separatorless short name, but if there is a collision we have to fallback
								# to a separated short name
								A_				 =						["", "_"]

								for separator in separators:
													A_				 =						separator.join(_snake_case	)
													if shortname not in info["reverse_short_param"]:
																		A_				 =						shortname
																		A_				 =						param_name
																		return shortname

								return param_name




			@staticmethod
			def      lowerCamelCase__     (				_snake_case						:					Dict       ,   _snake_case						:					List[Any]	)      -> Any:







								"""simple docstring"""
								A_				 =						TrialShortNamer.shortname_for_key(_snake_case       ,   _snake_case	)
								A_				 =						short_name
								A_				 =						param_name




			@classmethod
			def      lowerCamelCase__     (				cls						:					Optional[int]	)      -> List[str]:







								"""simple docstring"""
								if cls.NAMING_INFO is not None:
													return

								A_				 =						{
								    "short_word": {},
								    "reverse_short_word": {},
								    "short_param": {},
								    "reverse_short_param": {},
								}

								A_				 =						list(cls.DEFAULTS.keys()	)

								for k in field_keys:
													cls.add_new_param_name(_snake_case       ,   _snake_case	)

								A_				 =						info




			@classmethod
			def      lowerCamelCase__     (				cls						:					Union[str, Any]       ,   _snake_case						:					Any	)      -> Dict:







								"""simple docstring"""
								cls.build_naming_info()
								assert cls.PREFIX is not None
								A_				 =						[copy.copy(cls.PREFIX	)]

								for k, v in params.items():
													if k not in cls.DEFAULTS:
																		raise Exception(F'You should provide a default value for the param name {k} with value {v}'	)
													if v == cls.DEFAULTS[k]:
																		# The default value is not added to the name
																		continue

													A_				 =						cls.NAMING_INFO["short_param"][k]

													if isinstance(_snake_case       ,   _snake_case	):
																		A_				 =						1 if v else 0

													A_				 =						"" if isinstance(_snake_case       ,   (int, float)	) else "-"
													A_				 =						F'{key}{sep}{v}'
													name.append(_snake_case	)

								return "_".join(_snake_case	)






			@classmethod
			def      lowerCamelCase__     (				cls						:					List[Any]       ,   _snake_case						:					Optional[int]	)      -> List[Any]:







								"""simple docstring"""
								A_				 =						repr[len(cls.PREFIX	) + 1 :]
								if repr == "":
													A_				 =						[]
								else:
													A_				 =						repr.split("_"	)

								A_				 =						{}

								for value in values:
													if "-" in value:
																		A_ ,    A_				 =						value.split("-"	)
													else:
																		A_				 =						re.sub("[0-9.]"       ,   ""       ,   _snake_case	)
																		A_				 =						float(re.sub("[^0-9.]"       ,   ""       ,   _snake_case	)	)

													A_				 =						cls.NAMING_INFO["reverse_short_param"][p_k]

													A_				 =						p_v

								for k in cls.DEFAULTS:
													if k not in parameters:
																		A_				 =						cls.DEFAULTS[k]

								return parameters






"""simple docstring"""





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

from .haversine_distance import haversine_distance

UpperCamelCase_					:						Tuple				= 637_8137.0
UpperCamelCase_					:						List[str]				= 635_6752.31_4245
UpperCamelCase_					:						Dict				= 637_8137
def 							A_     (__a				,   __a				,   __a				,   __a				):

					'''simple docstring'''





					A_				 =						(AXIS_A - AXIS_B) / AXIS_A
					# Parametric latitudes
					# https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
					A_				 =						atan((1 - flattening) * tan(radians(__a				)				)				)
					A_				 =						atan((1 - flattening) * tan(radians(__a				)				)				)

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

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

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

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

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


if __name__ == "__main__":
		import doctest

		doctest.testmod()




