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

from .haversine_distance import haversine_distance

lowerCamelCase__  =					6378137.0
lowerCamelCase__  =					6356752.314245
lowerCamelCase__  =					637_8137


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




  '''simple docstring'''

  _UpperCamelCase           =    (AXIS_A - AXIS_B) / AXIS_A
  # Parametric latitudes
  # https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
  _UpperCamelCase           =    atan((1 - flattening) * tan(radians(a__ ) ) )
  _UpperCamelCase           =    atan((1 - flattening) * tan(radians(a__ ) ) )

  # Compute central angle between two points
  # using haversine theta. sigma =  haversine_distance / equatorial radius
  _UpperCamelCase           =    haversine_distance(a__    ,     a__    ,     a__    ,     a__ ) / EQUATORIAL_RADIUS

  # Intermediate P and Q values
  _UpperCamelCase           =    (b_lata + b_lata) / 2
  _UpperCamelCase           =    (b_lata - b_lata) / 2

  # Intermediate X value
  # X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
  _UpperCamelCase           =    (sin(a__ ) ** 2) * (cos(a__ ) ** 2)
  _UpperCamelCase           =    cos(sigma / 2 ) ** 2
  _UpperCamelCase           =    (sigma - sin(a__ )) * (x_numerator / x_demonimator)

  # Intermediate Y value
  # Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
  _UpperCamelCase           =    (cos(a__ ) ** 2) * (sin(a__ ) ** 2)
  _UpperCamelCase           =    sin(sigma / 2 ) ** 2
  _UpperCamelCase           =    (sigma + sin(a__ )) * (y_numerator / y_denominator)

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()





def 				lowerCAmelCase__       (			a__    ,     a__    ,     a__    ,     a__    ,     a__ )      ->int:




  '''simple docstring'''

  if index == number_of_items:
    return 0
  _UpperCamelCase           =    0
  _UpperCamelCase           =    0
  _UpperCamelCase           =    knapsack(a__    ,     a__    ,     a__    ,     a__    ,     index + 1 )
  if weights[index] <= max_weight:
    _UpperCamelCase           =    values[index] + knapsack(
        a__    ,     a__    ,     a__    ,     max_weight - weights[index]    ,     index + 1 )
  return max(a__    ,     a__ )


if __name__ == "__main__":
   import doctest

   doctest.testmod()




