


'''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'''



A__		:					Any												=  8.3_1_4_4_6_2  # Unit - J mol-1 K-1



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float							)     ->		float:
     if moles < 0 or kelvin < 0 or volume < 0:
          raise ValueError('Invalid inputs. Enter positive value.'							)
     return moles * kelvin * UNIVERSAL_GAS_CONSTANT / volume



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float							)     ->		float:
     if moles < 0 or kelvin < 0 or pressure < 0:
          raise ValueError('Invalid inputs. Enter positive value.'							)
     return moles * kelvin * UNIVERSAL_GAS_CONSTANT / pressure


if __name__ == "__main__":
      from doctest import testmod

      testmod()






