




'''simple docstring'''


from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
UpperCamelCase     =				9.8_06_65
def 				SCREAMING_SNAKE_CASE(      __lowercase		,							__lowercase  ) ->   None:

     # Ensure valid instance
     if not isinstance(__lowercase		,							(int, float)  ):
          raise TypeError('''Invalid velocity. Should be a positive number.'''  )

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

     # Ensure valid angle
     if angle > 9_0 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 				SCREAMING_SNAKE_CASE(      __lowercase		,							__lowercase  ) ->   float:
     check_args(__lowercase		,							__lowercase  )
     A:		List[str]        =		angle_to_radians(2 * angle  )
     return round(init_velocity**2 * sin(__lowercase  ) / g		,							2  )
def 				SCREAMING_SNAKE_CASE(      __lowercase		,							__lowercase  ) ->   float:
     check_args(__lowercase		,							__lowercase  )
     A:		List[str]        =		angle_to_radians(__lowercase  )
     return round(init_velocity**2 * sin(__lowercase  ) ** 2 / (2 * g)		,							2  )
def 				SCREAMING_SNAKE_CASE(      __lowercase		,							__lowercase  ) ->   float:
     check_args(__lowercase		,							__lowercase  )
     A:		List[str]        =		angle_to_radians(__lowercase  )
     return round(2 * init_velocity * sin(__lowercase  ) / g		,							2  )
def 				SCREAMING_SNAKE_CASE(      ) ->   None:
     A    ,						A:		Any        =		2_5, 2_0
     assert horizontal_distance(__lowercase		,							__lowercase  ) == 4_0.9_7
     assert max_height(__lowercase		,							__lowercase  ) == 3.7_3
     assert total_time(__lowercase		,							__lowercase  ) == 1.7_4


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

     testmod()

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

     # Get input from user
     UpperCamelCase     =				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'''


from collections import OrderedDict
from dataclasses import fields
from typing import Any, Tuple

import numpy as np

from .import_utils import is_torch_available
def 				SCREAMING_SNAKE_CASE(      __lowercase  ) ->   Tuple:
     if is_torch_available():
          import torch

          if isinstance(__lowercase		,							torch.Tensor  ):
               return True

     return isinstance(__lowercase		,							np.ndarray  )






class 	lowerCAmelCase_  (					UpperCAmelCase_       ):







  '''simple docstring'''

  def 				_snake_case    (   self							:       Union[str, Any]  ) ->		Dict:







       '''simple docstring'''



       A:		List[str]        =		fields(self  )

       # Safety and consistency checks
       if not len(SCREAMING_SNAKE_CASE_  ):
            raise ValueError(f"""{self.__class__.__name__} has no fields."""  )

       A:		Optional[Any]        =		getattr(self				,     class_fields[0].name  )
       A:		Any        =		all(getattr(self				,     field.name  ) is None for field in class_fields[1:]  )

       if other_fields_are_none and isinstance(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  ):
            for key, value in first_field.items():
                 A:		Any        =		value
       else:
            for field in class_fields:
                 A:		List[Any]        =		getattr(self				,     field.name  )
                 if v is not None:
                      A:		int        =		v



  def __delitem__(   self							:       Optional[int]				,     *SCREAMING_SNAKE_CASE_							:       Union[str, Any]				,     **SCREAMING_SNAKE_CASE_							:       List[str]  ) ->		List[str]:







       '''simple docstring'''



       raise Exception(f"""You cannot use ``__delitem__`` on a {self.__class__.__name__} instance."""  )



  def 				_snake_case    (   self							:       int				,     *SCREAMING_SNAKE_CASE_							:       Optional[Any]				,     **SCREAMING_SNAKE_CASE_							:       Any  ) ->		str:







       '''simple docstring'''



       raise Exception(f"""You cannot use ``setdefault`` on a {self.__class__.__name__} instance."""  )



  def 				_snake_case    (   self							:       int				,     *SCREAMING_SNAKE_CASE_							:       Dict				,     **SCREAMING_SNAKE_CASE_							:       Any  ) ->		Optional[Any]:







       '''simple docstring'''



       raise Exception(f"""You cannot use ``pop`` on a {self.__class__.__name__} instance."""  )



  def 				_snake_case    (   self							:       int				,     *SCREAMING_SNAKE_CASE_							:       int				,     **SCREAMING_SNAKE_CASE_							:       Optional[Any]  ) ->		int:







       '''simple docstring'''



       raise Exception(f"""You cannot use ``update`` on a {self.__class__.__name__} instance."""  )



  def __getitem__(   self							:       int				,     SCREAMING_SNAKE_CASE_							:       List[Any]  ) ->		Tuple:







       '''simple docstring'''



       if isinstance(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  ):
            A:		Any        =		dict(self.items()  )
            return inner_dict[k]
       else:
            return self.to_tuple()[k]



  def __setattr__(   self							:       Optional[Any]				,     SCREAMING_SNAKE_CASE_							:       Union[str, Any]				,     SCREAMING_SNAKE_CASE_							:       Union[str, Any]  ) ->		Dict:







       '''simple docstring'''



       if name in self.keys() and value is not None:
            # Don't call self.__setitem__ to avoid recursion errors
            super().__setitem__(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  )
       super().__setattr__(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  )



  def __setitem__(   self							:       Optional[Any]				,     SCREAMING_SNAKE_CASE_							:       Union[str, Any]				,     SCREAMING_SNAKE_CASE_							:       Union[str, Any]  ) ->		int:







       '''simple docstring'''



       super().__setitem__(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  )
       # Don't call self.__setattr__ to avoid recursion errors
       super().__setattr__(SCREAMING_SNAKE_CASE_				,     SCREAMING_SNAKE_CASE_  )




  def 				_snake_case    (   self							:       Optional[Any]  ) ->		Tuple[Any]:







       '''simple docstring'''



       return tuple(self[k] for k in self.keys()  )






