


'''simple docstring'''
from math import atan, cos, radians, sin, tan

from .haversine_distance import haversine_distance

__snake_case							      =     637_8137.0
__snake_case							      =     635_6752.31_4245
__snake_case							      =     6378137


def 			a      (			__a ,					__a ,					__a ,					__a   )  ->	float:



					'''simple docstring'''






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

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

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

					# Intermediate X value
					# X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
					UpperCamelCase__   :Tuple												= (sin(__a   ) ** 2) * (cos(__a   ) ** 2)
					UpperCamelCase__   :List[Any]												= cos(sigma / 2   ) ** 2
					UpperCamelCase__   :Optional[Any]												= (sigma - sin(__a   )) * (x_numerator / x_demonimator)

					# Intermediate Y value
					# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
					UpperCamelCase__   :Union[str, Any]												= (cos(__a   ) ** 2) * (sin(__a   ) ** 2)
					UpperCamelCase__   :List[str]												= sin(sigma / 2   ) ** 2
					UpperCamelCase__   :int												= (sigma + sin(__a   )) * (y_numerator / y_denominator)

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


if __name__ == "__main__":
		import doctest

		doctest.testmod()



'''simple docstring'''
from datetime import datetime

import matplotlib.pyplot as plt
import torch


def 			a      (			__a   )  ->	int:



					'''simple docstring'''






					for param in module.parameters():
										UpperCamelCase__   :Dict												= False


def 			a      (			)  ->	Union[str, Any]:



					'''simple docstring'''






					UpperCamelCase__   :List[Any]												= '''cuda''' if torch.cuda.is_available() else '''cpu'''
					if torch.backends.mps.is_available() and torch.backends.mps.is_built():
										UpperCamelCase__   :Optional[int]												= '''mps'''
					if device == "mps":
										print(
										    '''WARNING: MPS currently doesn\'t seem to work, and messes up backpropagation without any visible torch'''
										    ''' errors. I recommend using CUDA on a colab notebook or CPU instead if you\'re facing inexplicable issues'''
										    ''' with generations.'''   )
					return device


def 			a      (			__a   )  ->	Any:



					'''simple docstring'''






					UpperCamelCase__   :Dict												= plt.imshow(__a   )
					fig.axes.get_xaxis().set_visible(__a   )
					fig.axes.get_yaxis().set_visible(__a   )
					plt.show()







def 			a      (			)  ->	str:



					'''simple docstring'''






					UpperCamelCase__   :int												= datetime.now()
					UpperCamelCase__   :str												= current_time.strftime('''%H:%M:%S'''   )
					return timestamp