





"""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_0665





def 			a_							(				_lowercase			,		_lowercase  ):

						# 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 > 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  ):
						check_args(_lowercase			,		_lowercase  )
						_UpperCamelCase     :   Optional[int]      =       angle_to_radians(2 * angle  )
						return round(init_velocity**2 * sin(_lowercase  ) / g			,		2  )





def 			a_							(				_lowercase			,		_lowercase  ):
						check_args(_lowercase			,		_lowercase  )
						_UpperCamelCase     :   List[Any]      =       angle_to_radians(_lowercase  )
						return round(init_velocity**2 * sin(_lowercase  ) ** 2 / (2 * g)			,		2  )





def 			a_							(				_lowercase			,		_lowercase  ):
						check_args(_lowercase			,		_lowercase  )
						_UpperCamelCase     :   Any      =       angle_to_radians(_lowercase  )
						return round(2 * init_velocity * sin(_lowercase  ) / g			,		2  )





def 			a_							(				):
						_UpperCamelCase  ,				_UpperCamelCase     :   List[Any]      =       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
						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"""




import os
import sys
import time

from . import transposition_cipher as trans_cipher





def 			a_							(				):
						_UpperCamelCase     :   Dict      =       '''Prehistoric Men.txt'''
						_UpperCamelCase     :   Optional[Any]      =       '''Output.txt'''
						_UpperCamelCase     :   Any      =       int(input('''Enter key: '''  )  )
						_UpperCamelCase     :   Optional[Any]      =       input('''Encrypt/Decrypt [e/d]: '''  )

						if not os.path.exists(_lowercase  ):
												print(F"""File {input_file} does not exist. Quitting..."""  )
												sys.exit()
						if os.path.exists(_lowercase  ):
												print(F"""Overwrite {output_file}? [y/n]"""  )
												_UpperCamelCase     :   Optional[int]      =       input('''> '''  )
												if not response.lower().startswith('''y'''  ):
																		sys.exit()

						_UpperCamelCase     :   List[str]      =       time.time()
						if mode.lower().startswith('''e'''  ):
												with open(_lowercase  ) as f:
																		_UpperCamelCase     :   Optional[int]      =       f.read()
												_UpperCamelCase     :   List[str]      =       trans_cipher.encrypt_message(_lowercase			,		_lowercase  )
						elif mode.lower().startswith('''d'''  ):
												with open(_lowercase  ) as f:
																		_UpperCamelCase     :   Dict      =       f.read()
												_UpperCamelCase     :   Any      =       trans_cipher.decrypt_message(_lowercase			,		_lowercase  )

						with open(_lowercase			,		'''w'''  ) as output_obj:
												output_obj.write(_lowercase  )

						_UpperCamelCase     :   List[str]      =       round(time.time() - start_time			,		2  )
						print(('''Done (''', total_time, '''seconds )''')  )


if __name__ == "__main__":
						main()



