


'''simple docstring'''







from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowercase__     :  List[Any]    					=			logging.get_logger(__name__)

lowercase__     :  Union[str, Any]    					=			{
    'MBZUAI/swiftformer-xs': 'https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json',
}

class       lowerCamelCase_							(	lowerCAmelCase_  ):






   '''simple docstring'''

   A :     Dict				=	"swiftformer"


   def __init__(  self     ,						__UpperCamelCase=3     ,						__UpperCamelCase=[3, 3, 6, 4]     ,						__UpperCamelCase=[48, 56, 1_12, 2_20]     ,						__UpperCamelCase=4     ,						__UpperCamelCase=[True, True, True, True]     ,						__UpperCamelCase="gelu"     ,						__UpperCamelCase=3     ,						__UpperCamelCase=2     ,						__UpperCamelCase=1     ,						__UpperCamelCase=0.0     ,						__UpperCamelCase=True     ,						__UpperCamelCase=1e-5     ,						__UpperCamelCase=1e-5     ,						**__UpperCamelCase     ,						):
       super().__init__(**__UpperCamelCase )
       UpperCamelCase__      =			num_channels
       UpperCamelCase__      =			depths
       UpperCamelCase__      =			embed_dims
       UpperCamelCase__      =			mlp_ratio
       UpperCamelCase__      =			downsamples
       UpperCamelCase__      =			hidden_act
       UpperCamelCase__      =			down_patch_size
       UpperCamelCase__      =			down_stride
       UpperCamelCase__      =			down_pad
       UpperCamelCase__      =			drop_path_rate
       UpperCamelCase__      =			use_layer_scale
       UpperCamelCase__      =			layer_scale_init_value
       UpperCamelCase__      =			batch_norm_eps

class       lowerCamelCase_							(	lowerCAmelCase_  ):






   '''simple docstring'''

   A :     Tuple				=	version.parse("1.11"  )


   @property
   def 	_UpperCamelCase       (  self ):
       return OrderedDict(
           [
               ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
           ] )







   @property
   def 	_UpperCamelCase       (  self ):
       return 1e-4









'''simple docstring'''







from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
lowercase__     :  str    					=			9.8_0_6_6_5





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):

    # Ensure valid instance
    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 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):
    check_args(lowerCAmelCase_					,  lowerCAmelCase_	)
    UpperCamelCase__      =			angle_to_radians(2 * angle	)
    return round(init_velocity**2 * sin(lowerCAmelCase_	) / g					,  2	)





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):
    check_args(lowerCAmelCase_					,  lowerCAmelCase_	)
    UpperCamelCase__      =			angle_to_radians(lowerCAmelCase_	)
    return round(init_velocity**2 * sin(lowerCAmelCase_	) ** 2 / (2 * g)					,  2	)





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):
    check_args(lowerCAmelCase_					,  lowerCAmelCase_	)
    UpperCamelCase__      =			angle_to_radians(lowerCAmelCase_	)
    return round(2 * init_velocity * sin(lowerCAmelCase_	) / g					,  2	)





def 						snake_case__ ():
    UpperCamelCase__    ,  UpperCamelCase__      =			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
      lowercase__     :  Union[str, Any]    					=			float(input('Initial Velocity: ').strip())

      # Get input from user
      lowercase__     :  Any    					=			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]''')




