





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

UpperCAmelCase_									=       6378137.0
UpperCAmelCase_									=       6356752.314245
UpperCAmelCase_									=       6378137





def   lowerCamelCase__       (       UpperCamelCase__     :    float    ,      UpperCamelCase__     :    float    ,      UpperCamelCase__     :    float    ,      UpperCamelCase__     :    float  )     ->	float:



					'''simple docstring'''




					_snake_case													=			(AXIS_A - AXIS_B) / AXIS_A
					_snake_case													=			atan((1 - flattening) * tan(radians(UpperCamelCase__  )  )  )
					_snake_case													=			atan((1 - flattening) * tan(radians(UpperCamelCase__  )  )  )
					_snake_case													=			radians(UpperCamelCase__  )
					_snake_case													=			radians(UpperCamelCase__  )
					# Equation
					_snake_case													=			sin((phi_a - phi_a) / 2  )
					_snake_case													=			sin((lambda_a - lambda_a) / 2  )
					# Square both values
					sin_sq_phi *= sin_sq_phi
					sin_sq_lambda *= sin_sq_lambda
					_snake_case													=			sqrt(sin_sq_phi + (cos(UpperCamelCase__  ) * cos(UpperCamelCase__  ) * sin_sq_lambda)  )
					return 2 * RADIUS * asin(UpperCamelCase__  )


if __name__ == "__main__":
					import doctest

					doctest.testmod()










from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst





def   lowerCamelCase__       (       )     ->	List[str]:



					'''simple docstring'''




					_snake_case							,       _snake_case													=			9, 14  # noqa: F841
					_snake_case													=			[
					    [0, 1, 4],
					    [0, 7, 8],
					    [1, 2, 8],
					    [7, 8, 7],
					    [7, 6, 1],
					    [2, 8, 2],
					    [8, 6, 6],
					    [2, 3, 7],
					    [2, 5, 4],
					    [6, 5, 2],
					    [3, 5, 14],
					    [3, 4, 9],
					    [5, 4, 10],
					    [1, 7, 11],
					]

					_snake_case													=			defaultdict(UpperCamelCase__  )
					for nodea, nodea, cost in edges:
										adjancency[nodea].append([nodea, cost]  )
										adjancency[nodea].append([nodea, cost]  )

					_snake_case													=			mst(UpperCamelCase__  )

					_snake_case													=			[
					    [7, 6, 1],
					    [2, 8, 2],
					    [6, 5, 2],
					    [0, 1, 4],
					    [2, 5, 4],
					    [2, 3, 7],
					    [0, 7, 8],
					    [3, 4, 9],
					]

					for answer in expected:
										_snake_case													=			tuple(answer[:2]  )
										_snake_case													=			tuple(edge[::-1]  )
										assert edge in result or reverse in result



