
"""simple docstring"""







import importlib.metadata
import sys

from transformers.testing_utils import TestCasePlus
from transformers.utils.versions import require_version, require_version_core


lowercase_						    =					importlib.metadata.version("numpy")
lowercase_						    =					".".join([str(x) for x in sys.version_info[:3]])



class 		UpperCAmelCase_	(lowerCamelCase_						):
 """simple docstring"""




 def   a      ( self       : Union[str, Any] )->					List[str]:



      """simple docstring"""

      require_version_core("""numpy<1000.4.5""" )
      require_version_core("""numpy<1000.4""" )
      require_version_core("""numpy<1000""" )

      # le
      require_version_core("""numpy<=1000.4.5""" )
      require_version_core(f'''numpy<={numpy_ver}''' )

      # eq
      require_version_core(f'''numpy=={numpy_ver}''' )

      # ne
      require_version_core("""numpy!=1000.4.5""" )

      # ge
      require_version_core("""numpy>=1.0""" )
      require_version_core("""numpy>=1.0.0""" )
      require_version_core(f'''numpy>={numpy_ver}''' )

      # gt
      require_version_core("""numpy>1.0.0""" )

      # mix
      require_version_core("""numpy>1.0.0,<1000""" )

      # requirement w/o version
      require_version_core("""numpy""" )

      # unmet requirements due to version conflict
      for req in ["numpy==1.0.0", "numpy>=1000.0.0", f'''numpy<{numpy_ver}''']:
           try:
                require_version_core(a_ )
           except ImportError as e:
                self.assertIn(f'''{req} is required'''     ,   str(a_ ) )
                self.assertIn("""but found"""     ,   str(a_ ) )

        # unmet requirements due to missing module
      for req in ["numpipypie>1", "numpipypie2"]:
           try:
                require_version_core(a_ )
           except importlib.metadata.PackageNotFoundError as e:
                self.assertIn(f'''The \'{req}\' distribution was not found and is required by this application'''     ,   str(a_ ) )
                self.assertIn("""Try: pip install transformers -U"""     ,   str(a_ ) )

        # bogus requirements formats:
        # 1. whole thing
      for req in ["numpy??1.0.0", "numpy1.0.0"]:
           try:
                require_version_core(a_ )
           except ValueError as e:
                self.assertIn("""requirement needs to be in the pip package format"""     ,   str(a_ ) )
        # 2. only operators
      for req in ["numpy=1.0.0", "numpy == 1.00", "numpy<>1.0.0", "numpy><1.00", "numpy>>1.0.0"]:
           try:
                require_version_core(a_ )
           except ValueError as e:
                self.assertIn("""need one of """     ,   str(a_ ) )






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



      """simple docstring"""

      require_version("""python>=3.6.0""" )

      # not matching requirements
      for req in ["python>9.9.9", "python<3.0.0"]:
           try:
                require_version_core(a_ )
           except ImportError as e:
                self.assertIn(f'''{req} is required'''     ,   str(a_ ) )
                self.assertIn(f'''but found python=={python_ver}'''     ,   str(a_ ) )



"""simple docstring"""







from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
lowercase_						    =					9.8_0665




def 			A_			(					lowercase						, lowercase      )     ->							None:


     """simple docstring"""







     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 > 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 			A_			(					lowercase						, lowercase      )     ->							float:


     """simple docstring"""







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




def 			A_			(					lowercase						, lowercase      )     ->							float:


     """simple docstring"""







     check_args(lowercase						, lowercase      )
     UpperCAmelCase_						:    Union[str, Any]    					=  angle_to_radians(lowercase      )
     return round(init_velocity**2 * sin(lowercase      ) ** 2 / (2 * g)						, 2      )




def 			A_			(					lowercase						, lowercase      )     ->							float:


     """simple docstring"""







     check_args(lowercase						, lowercase      )
     UpperCAmelCase_						:    Optional[int]    					=  angle_to_radians(lowercase      )
     return round(2 * init_velocity * sin(lowercase      ) / g						, 2      )




def 			A_			(					)     ->							None:


     """simple docstring"""







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


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

       testmod()

       # Get input from user
       lowercase_						    =					float(input("Initial Velocity: ").strip())

       # Get input from user
       lowercase_						    =					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]""")

