
"""simple docstring"""







import unittest

from transformers.image_processing_utils import get_size_dict



class 		UpperCAmelCase_	(unittest.TestCase						):
 """simple docstring"""




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



      """simple docstring"""

      UpperCAmelCase_						:    Any    					=  {"""wrong_key""": 2_24}
      with self.assertRaises(a_ ):
           get_size_dict(a_ )

      UpperCAmelCase_						:    Union[str, Any]    					=  {"""height""": 2_24}
      with self.assertRaises(a_ ):
           get_size_dict(a_ )

      UpperCAmelCase_						:    Union[str, Any]    					=  {"""width""": 2_24, """shortest_edge""": 2_24}
      with self.assertRaises(a_ ):
           get_size_dict(a_ )

      # Test a dict with the correct keys is returned as is
      UpperCAmelCase_						:    int    					=  {"""height""": 2_24, """width""": 2_24}
      UpperCAmelCase_						:    Dict    					=  get_size_dict(a_ )
      self.assertEqual(a_     ,   a_ )

      UpperCAmelCase_						:    Optional[int]    					=  {"""shortest_edge""": 2_24}
      UpperCAmelCase_						:    Tuple    					=  get_size_dict(a_ )
      self.assertEqual(a_     ,   {"""shortest_edge""": 2_24} )

      UpperCAmelCase_						:    str    					=  {"""longest_edge""": 2_24, """shortest_edge""": 2_24}
      UpperCAmelCase_						:    Any    					=  get_size_dict(a_ )
      self.assertEqual(a_     ,   {"""longest_edge""": 2_24, """shortest_edge""": 2_24} )

      # Test a single int value which  represents (size, size)
      UpperCAmelCase_						:    Optional[Any]    					=  get_size_dict(2_24 )
      self.assertEqual(a_     ,   {"""height""": 2_24, """width""": 2_24} )

      # Test a single int value which represents the shortest edge
      UpperCAmelCase_						:    List[str]    					=  get_size_dict(2_24     ,   default_to_square=a_ )
      self.assertEqual(a_     ,   {"""shortest_edge""": 2_24} )

      # Test a tuple of ints which represents (height, width)
      UpperCAmelCase_						:    List[Any]    					=  get_size_dict((1_50, 2_00) )
      self.assertEqual(a_     ,   {"""height""": 1_50, """width""": 2_00} )

      # Test a tuple of ints which represents (width, height)
      UpperCAmelCase_						:    List[str]    					=  get_size_dict((1_50, 2_00)     ,   height_width_order=a_ )
      self.assertEqual(a_     ,   {"""height""": 2_00, """width""": 1_50} )

      # Test an int representing the shortest edge and max_size which represents the longest edge
      UpperCAmelCase_						:    List[Any]    					=  get_size_dict(2_24     ,   max_size=2_56     ,   default_to_square=a_ )
      self.assertEqual(a_     ,   {"""shortest_edge""": 2_24, """longest_edge""": 2_56} )

      # Test int with default_to_square=True and max_size fails
      with self.assertRaises(a_ ):
           get_size_dict(2_24     ,   max_size=2_56     ,   default_to_square=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]""")

