





"""simple docstring"""






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

from .haversine_distance import haversine_distance

__UpperCAmelCase						=			6_37_81_37.0
__UpperCAmelCase						=			6_35_67_52.31_42_45
__UpperCAmelCase						=			637_8137






def      lowercase__ (					lowerCAmelCase__   :			float							,			lowerCAmelCase__   :			float							,			lowerCAmelCase__   :			float							,			lowerCAmelCase__   :			float			)    ->			float:



			'''simple docstring'''
			a__  :	str		 =			(AXIS_A - AXIS_B) / AXIS_A
			# Parametric latitudes
			# https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
			a__  :	Dict		 =			atan((1 - flattening) * tan(radians(lowerCAmelCase__			)			)			)
			a__  :	Tuple		 =			atan((1 - flattening) * tan(radians(lowerCAmelCase__			)			)			)

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

			# Intermediate P and Q values
			a__  :	Tuple		 =			(b_lata + b_lata) / 2
			a__  :	List[str]		 =			(b_lata - b_lata) / 2

			# Intermediate X value
			# X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
			a__  :	int		 =			(sin(lowerCAmelCase__			) ** 2) * (cos(lowerCAmelCase__			) ** 2)
			a__  :	Any		 =			cos(sigma / 2			) ** 2
			a__  :	Tuple		 =			(sigma - sin(lowerCAmelCase__			)) * (x_numerator / x_demonimator)

			# Intermediate Y value
			# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
			a__  :	Optional[Any]		 =			(cos(lowerCAmelCase__			) ** 2) * (sin(lowerCAmelCase__			) ** 2)
			a__  :	str		 =			sin(sigma / 2			) ** 2
			a__  :	Union[str, Any]		 =			(sigma + sin(lowerCAmelCase__			)) * (y_numerator / y_denominator)

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


if __name__ == "__main__":
		import doctest

		doctest.testmod()






"""simple docstring"""






from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase						=			{
    '''configuration_informer''': [
        '''INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''InformerConfig''',
    ],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase						=			[
		    '''INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''InformerForPrediction''',
		    '''InformerModel''',
		    '''InformerPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_informer import (
				    INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    InformerForPrediction,
				    InformerModel,
				    InformerPreTrainedModel,
				)

else:
		import sys

		__UpperCAmelCase						=			_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)