



"""simple docstring"""

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

from .haversine_distance import haversine_distance

a_			   =					6378137.0
a_			   =					6356752.314245
a_			   =					6378137







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  float				,    SCREAMING_SNAKE_CASE__ :  float				,    SCREAMING_SNAKE_CASE__ :  float				,    SCREAMING_SNAKE_CASE__ :  float			):



					"""simple docstring"""





					snake_case_					:		Dict 					=					(AXIS_A - AXIS_B) / AXIS_A
					# Parametric latitudes
					# https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
					snake_case_					:		Union[str, Any] 					=					atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE__			)			)			)
					snake_case_					:		List[Any] 					=					atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE__			)			)			)

					# Compute central angle between two points
					# using haversine theta. sigma =  haversine_distance / equatorial radius
					snake_case_					:		Union[str, Any] 					=					haversine_distance(SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__			) / EQUATORIAL_RADIUS

					# Intermediate P and Q values
					snake_case_					:		Union[str, Any] 					=					(b_lata + b_lata) / 2
					snake_case_					:		Optional[int] 					=					(b_lata - b_lata) / 2

					# Intermediate X value
					# X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
					snake_case_					:		int 					=					(sin(SCREAMING_SNAKE_CASE__			) ** 2) * (cos(SCREAMING_SNAKE_CASE__			) ** 2)
					snake_case_					:		Optional[Any] 					=					cos(sigma / 2			) ** 2
					snake_case_					:		Optional[Any] 					=					(sigma - sin(SCREAMING_SNAKE_CASE__			)) * (x_numerator / x_demonimator)

					# Intermediate Y value
					# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
					snake_case_					:		Optional[int] 					=					(cos(SCREAMING_SNAKE_CASE__			) ** 2) * (sin(SCREAMING_SNAKE_CASE__			) ** 2)
					snake_case_					:		List[str] 					=					sin(sigma / 2			) ** 2
					snake_case_					:		Optional[Any] 					=					(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()









"""simple docstring"""

import random







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  int				,    SCREAMING_SNAKE_CASE__ :  float				,    SCREAMING_SNAKE_CASE__ :  bool = False			):



					"""simple docstring"""





					snake_case_					:		dict 					=					{i: [] for i in range(SCREAMING_SNAKE_CASE__			)}

					# if probability is greater or equal than 1, then generate a complete graph
					if probability >= 1:
										return complete_graph(SCREAMING_SNAKE_CASE__			)
					# if probability is lower or equal than 0, then return a graph without edges
					if probability <= 0:
										return graph

					# for each couple of nodes, add an edge from u to v
					# if the number randomly generated is greater than probability probability
					for i in range(SCREAMING_SNAKE_CASE__			):
										for j in range(i + 1				,    SCREAMING_SNAKE_CASE__			):
															if random.random() < probability:
																				graph[i].append(SCREAMING_SNAKE_CASE__			)
																				if not directed:
																									# if the graph is undirected, add an edge in from j to i, either
																									graph[j].append(SCREAMING_SNAKE_CASE__			)
					return graph







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  int			):



					"""simple docstring"""





					return {
					    i: [j for j in range(SCREAMING_SNAKE_CASE__			) if i != j] for i in range(SCREAMING_SNAKE_CASE__			)
					}


if __name__ == "__main__":
			import doctest

			doctest.testmod()




