


import math





def __UpperCAmelCase       (		__A			)						->					int:



       '''simple docstring'''





       if not isinstance(__A ,						__A			):
              UpperCAmelCase__										=     F"""Input value of [number={number}] must be an integer"""
              raise TypeError(__A			)

       if number < 1:
              UpperCAmelCase__										=     F"""Input value of [number={number}] must be > 0"""
              raise ValueError(__A			)
       elif number == 1:
              return 3
       elif number == 2:
              return 5
       else:
              UpperCAmelCase__										=     int(math.log(number // 3 ,						2			)			) + 2

              UpperCAmelCase__										=     [3, 5]
              UpperCAmelCase__										=     2
              UpperCAmelCase__										=     3
              for block in range(1 ,						__A			):
                     for _ in range(__A			):
                            proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]			)
                            proth_index += 1
                     increment *= 2

       return proth_list[number - 1]


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    for number in range(11):
        A      = 0
        try:
            A      = proth(number)
        except ValueError:
            print(f"ValueError: there is no {number}th Proth number")
            continue

        print(f"The {number}th Proth number: {value}")









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

from .haversine_distance import haversine_distance

A      = 6378137.0
A      = 6356752.314245
A      = 637_8137





def __UpperCAmelCase       (		__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()





