
'''simple docstring'''


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

snake_case_ :  Union[str, Any]     =					6378137.0
snake_case_ :  int     =					6356752.314245
snake_case_ :  List[Any]     =					6_378_137



def  __snake_case     (    _UpperCAmelCase					:       Optional[Any],      _UpperCAmelCase					:       List[str],      _UpperCAmelCase					:       Tuple,      _UpperCAmelCase					:       Union[str, Any]):
   UpperCamelCase       =  (AXIS_A - AXIS_B) / AXIS_A
   UpperCamelCase       =  atan((1 - flattening) * tan(radians(a__)))
   UpperCamelCase       =  atan((1 - flattening) * tan(radians(a__)))
   UpperCamelCase       =  radians(a__)
   UpperCamelCase       =  radians(a__)
   # Equation
   UpperCamelCase       =  sin((phi_a - phi_a) / 2)
   UpperCamelCase       =  sin((lambda_a - lambda_a) / 2)
   # Square both values
   sin_sq_phi *= sin_sq_phi
   sin_sq_lambda *= sin_sq_lambda
   UpperCamelCase       =  sqrt(sin_sq_phi + (cos(a__) * cos(a__) * sin_sq_lambda))
   return 2 * RADIUS * asin(a__)


if __name__ == "__main__":
   import doctest

   doctest.testmod()







'''simple docstring'''


from __future__ import annotations



def  __snake_case     (    _UpperCAmelCase					:       list[int]):
   UpperCamelCase       =  len(_UpperCAmelCase) // 2

   # choose the middle 3 elements
   UpperCamelCase       =  lst[m - 1 : m + 2]

   # if middle element is peak
   if three[1] > three[0] and three[1] > three[2]:
      return three[1]

   # if increasing, recurse on right
   elif three[0] < three[2]:
      if len(lst[:m]) == 2:
         m -= 1
      return peak(lst[m:])

   # decreasing
   else:
      if len(lst[:m]) == 2:
         m += 1
      return peak(lst[:m])


if __name__ == "__main__":
   import doctest

   doctest.testmod()





