
"""simple docstring"""







from ctypes import c_float, sizeof
from enum import Enum
from typing import TYPE_CHECKING, Optional, Union


if TYPE_CHECKING:
       from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore



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




       UpperCamelCase_						:     int				   =    c_float




       @property
       def   a      ( self       : Tuple )->					int:



            """simple docstring"""

            return sizeof(self.value )




def 			A_			(					lowercase						, lowercase						, lowercase = 0      )     ->							List[str]:


     """simple docstring"""







     if dimension <= 0:
          UpperCAmelCase_						:    List[str]    					=  fixed_dimension

     dimension -= num_token_to_add
     return dimension




def 			A_			(					lowercase						, lowercase      )     ->							Any:


     """simple docstring"""







     return num_parameters * dtype.size




def 			A_			(					lowercase      )     ->							Tuple:


     """simple docstring"""







     from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore

     try:
          return AutoProcessor.from_pretrained(lowercase_      )
     except (ValueError, OSError, KeyError):
          UpperCAmelCase_						:    Dict    					=  None, None
          try:
               UpperCAmelCase_						:    List[Any]    					=  AutoTokenizer.from_pretrained(lowercase_      )
          except (OSError, KeyError):
               pass
          try:
               UpperCAmelCase_						:    List[str]    					=  AutoFeatureExtractor.from_pretrained(lowercase_      )
          except (OSError, KeyError):
               pass

          if tokenizer is not None and feature_extractor is not None:
               raise ValueError(
                   f'''Couldn\'t auto-detect preprocessor for {model_name}. Found both a tokenizer and a feature extractor.'''      )
          elif tokenizer is None and feature_extractor is None:
               return None
          elif tokenizer is not None:
               return tokenizer
          else:
               return feature_extractor



"""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]""")

