





"""simple docstring"""




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

from .haversine_distance import haversine_distance

UpperCamelCase_									=637_8137.0
UpperCamelCase_									=635_6752.31_4245
UpperCamelCase_									=6_378_137





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

						# Compute central angle between two points
						# using haversine theta. sigma =  haversine_distance / equatorial radius
						_UpperCamelCase      : Optional[Any]         =   haversine_distance(_lowercase	,						_lowercase	,						_lowercase	,						_lowercase       ) / EQUATORIAL_RADIUS

						# Intermediate P and Q values
						_UpperCamelCase      : Optional[int]         =   (b_lata + b_lata) / 2
						_UpperCamelCase      : List[str]         =   (b_lata - b_lata) / 2

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

						# Intermediate Y value
						# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
						_UpperCamelCase      : Optional[int]         =   (cos(_lowercase       ) ** 2) * (sin(_lowercase       ) ** 2)
						_UpperCamelCase      : Optional[int]         =   sin(sigma / 2       ) ** 2
						_UpperCamelCase      : Union[str, Any]         =   (sigma + sin(_lowercase       )) * (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_flax_available, is_torch_available


if is_torch_available():
						from .autoencoder_kl import AutoencoderKL
						from .controlnet import ControlNetModel
						from .dual_transformer_ad import DualTransformeraDModel
						from .modeling_utils import ModelMixin
						from .prior_transformer import PriorTransformer
						from .ta_film_transformer import TaFilmDecoder
						from .transformer_ad import TransformeraDModel
						from .unet_ad import UNetaDModel
						from .unet_ad import UNetaDModel
						from .unet_ad_condition import UNetaDConditionModel
						from .unet_ad_condition import UNetaDConditionModel
						from .vq_model import VQModel

if is_flax_available():
						from .controlnet_flax import FlaxControlNetModel
						from .unet_ad_condition_flax import FlaxUNetaDConditionModel
						from .vae_flax import FlaxAutoencoderKL



