'''simple docstring'''


from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
snake_case__	:     Optional[int]      =    9.80_665


def    _lowerCamelCase       ( lowerCamelCase_   :				float      ,	lowerCamelCase_   :				float  ):



     """simple docstring"""





     if not isinstance(lowerCamelCase_      ,	(int, float)  ):
          raise TypeError('Invalid velocity. Should be a positive number.'  )

     if not isinstance(lowerCamelCase_      ,	(int, float)  ):
          raise TypeError('Invalid angle. Range is 1-90 degrees.'  )

     # Ensure valid angle
     if angle > 90 or angle < 1:
          raise ValueError('Invalid angle. Range is 1-90 degrees.'  )

     # Ensure valid velocity
     if init_velocity < 0:
          raise ValueError('Invalid velocity. Should be a positive number.'  )


def    _lowerCamelCase       ( lowerCamelCase_   :				float      ,	lowerCamelCase_   :				float  ):



     """simple docstring"""





     check_args(lowerCamelCase_      ,	lowerCamelCase_  )
     UpperCAmelCase_				:  Dict  = angle_to_radians(2 * angle  )
     return round(init_velocity**2 * sin(lowerCamelCase_  ) / g      ,	2  )


def    _lowerCamelCase       ( lowerCamelCase_   :				float      ,	lowerCamelCase_   :				float  ):



     """simple docstring"""





     check_args(lowerCamelCase_      ,	lowerCamelCase_  )
     UpperCAmelCase_				:  Any  = angle_to_radians(lowerCamelCase_  )
     return round(init_velocity**2 * sin(lowerCamelCase_  ) ** 2 / (2 * g)      ,	2  )


def    _lowerCamelCase       ( lowerCamelCase_   :				float      ,	lowerCamelCase_   :				float  ):



     """simple docstring"""





     check_args(lowerCamelCase_      ,	lowerCamelCase_  )
     UpperCAmelCase_				:  Any  = angle_to_radians(lowerCamelCase_  )
     return round(2 * init_velocity * sin(lowerCamelCase_  ) / g      ,	2  )


def    _lowerCamelCase       ( ):



     """simple docstring"""





     UpperCAmelCase_  ,     UpperCAmelCase_				:  Optional[Any]  = 25, 20
     assert horizontal_distance(lowerCamelCase_      ,	lowerCamelCase_  ) == 40.97
     assert max_height(lowerCamelCase_      ,	lowerCamelCase_  ) == 3.73
     assert total_time(lowerCamelCase_      ,	lowerCamelCase_  ) == 1.74


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

 testmod()

 # Get input from user
 snake_case__	:     Tuple      =    float(input('''Initial Velocity: ''').strip())

 # Get input from user
 snake_case__	:     int      =    float(input('''angle: ''').strip())

 # Print results
 print()
 print('''Results: ''')
 print(f'''Horizontal Distance: {horizontal_distance(init_vel, angle)!s} [m]''')
 print(f'''Maximum Height: {max_height(init_vel, angle)!s} [m]''')
 print(f'''Total Time: {total_time(init_vel, angle)!s} [s]''')







'''simple docstring'''


def    _lowerCamelCase       ( lowerCamelCase_   :				list  ):



     """simple docstring"""





     UpperCAmelCase_				:  Optional[int]  = len(lowerCamelCase_  )

     # Set the gap value to be decreased by a factor of 1.3
     # after each iteration
     UpperCAmelCase_				:  Optional[Any]  = 1.3

     # Continue sorting until the gap is 1
     while gap > 1:
          # Decrease the gap value
          UpperCAmelCase_				:  Optional[Any]  = int(gap / shrink  )

          # Sort the elements using insertion sort
          for i in range(lowerCamelCase_      ,	len(lowerCamelCase_  )  ):
               UpperCAmelCase_				:  Optional[int]  = collection[i]
               UpperCAmelCase_				:  Tuple  = i
               while j >= gap and collection[j - gap] > temp:
                    UpperCAmelCase_				:  Tuple  = collection[j - gap]
                    j -= gap
               UpperCAmelCase_				:  Optional[int]  = temp

     return collection


if __name__ == "__main__":
 import doctest

 doctest.testmod()






