


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

from .haversine_distance import haversine_distance

SCREAMING_SNAKE_CASE :    List[str]									=				6_378_137.0
SCREAMING_SNAKE_CASE :    Tuple									=				6_356_752.314_245
SCREAMING_SNAKE_CASE :    Dict									=				637_8137






def 		lowercase							(     _snake_case						:      float     ,   _snake_case						:      float     ,   _snake_case						:      float     ,   _snake_case						:      float     )     ->float:
	"""simple docstring"""





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

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

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

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

	# Intermediate Y value
	# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
	__snake_case	:						Optional[Any]						=				(cos(_snake_case     ) ** 2) * (sin(_snake_case     ) ** 2)
	__snake_case	:						List[Any]						=				sin(sigma / 2     ) ** 2
	__snake_case	:						Optional[int]						=				(sigma + sin(_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"""
from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
			from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline





