



from __future__ import annotations

import math

__A							       =		'''2020.9.26'''
__A							       =		'''xcodz-dot, cclaus, dhruvmanila'''



def 			__a	(       lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   float							) ->					Union[str, Any]:






						'''simple docstring'''



						if not all(isinstance(__lowerCamelCase     ,(float, int)							) for val in locals().values()							):
												UpperCAmelCase_=  F"""Input values must either be float or int: {list(locals().values()							)}"""
												raise TypeError(__lowerCamelCase							)
						UpperCAmelCase_=  ((x * distance) / (z + distance)) * scale
						UpperCAmelCase_=  ((y * distance) / (z + distance)) * scale
						return projected_x, projected_y



def 			__a	(       lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   float     ,lowerCAmelCase_  :   str     ,lowerCAmelCase_  :   float							) ->					Optional[Any]:






						'''simple docstring'''



						if not isinstance(__lowerCamelCase     ,__lowerCamelCase							):
												raise TypeError("""Axis must be a str"""							)
						UpperCAmelCase_=  locals()
						del input_variables["axis"]
						if not all(isinstance(__lowerCamelCase     ,(float, int)							) for val in input_variables.values()							):
												UpperCAmelCase_=  (
												    'Input values except axis must either be float or int: '
												    F"""{list(input_variables.values()							)}"""
												)
												raise TypeError(__lowerCamelCase							)
						UpperCAmelCase_=  (angle % 3_60) / 4_50 * 1_80 / math.pi
						if axis == "z":
												UpperCAmelCase_=  x * math.cos(__lowerCamelCase							) - y * math.sin(__lowerCamelCase							)
												UpperCAmelCase_=  y * math.cos(__lowerCamelCase							) + x * math.sin(__lowerCamelCase							)
												UpperCAmelCase_=  z
						elif axis == "x":
												UpperCAmelCase_=  y * math.cos(__lowerCamelCase							) - z * math.sin(__lowerCamelCase							)
												UpperCAmelCase_=  z * math.cos(__lowerCamelCase							) + y * math.sin(__lowerCamelCase							)
												UpperCAmelCase_=  x
						elif axis == "y":
												UpperCAmelCase_=  x * math.cos(__lowerCamelCase							) - z * math.sin(__lowerCamelCase							)
												UpperCAmelCase_=  z * math.cos(__lowerCamelCase							) + x * math.sin(__lowerCamelCase							)
												UpperCAmelCase_=  y
						else:
												raise ValueError("""not a valid axis, choose one of \'x\', \'y\', \'z\'"""							)

						return new_x, new_y, new_z


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(f'{convert_to_ad(1.0, 2.0, 3.0, 1_0.0, 1_0.0) = }')
	print(f'{rotate(1.0, 2.0, 3.0, "y", 9_0.0) = }')








'''simple docstring'''






def lowerCamelCase__     (		__lowerCamelCase			:				str				):







   '''simple docstring'''




   _UpperCAmelCase  :  Dict				       =''
   for ch in key:
      if ch == " " or ch not in key_no_dups and ch.isalpha():
         key_no_dups += ch
   return key_no_dups





def lowerCamelCase__     (		__lowerCamelCase			:				str				):







   '''simple docstring'''




   _UpperCAmelCase  :  List[str]				       =[chr(i + 6_5				) for i in range(2_6				)]
   # Remove duplicate characters from key
   _UpperCAmelCase  :  Any				       =remove_duplicates(key.upper()				)
   _UpperCAmelCase  :  Optional[Any]				       =len(__lowerCamelCase				)
   # First fill cipher with key characters
   _UpperCAmelCase  :  List[Any]				       ={alphabet[i]: char for i, char in enumerate(__lowerCamelCase				)}
   # Then map remaining characters in alphabet to
   # the alphabet from the beginning
   for i in range(len(__lowerCamelCase				)			,       2_6				):
      _UpperCAmelCase  :  Union[str, Any]				       =alphabet[i - offset]
      # Ensure we are not mapping letters to letters previously mapped
      while char in key:
         offset -= 1
         _UpperCAmelCase  :  str				       =alphabet[i - offset]
      _UpperCAmelCase  :  Any				       =char
   return cipher_alphabet





def lowerCamelCase__     (		__lowerCamelCase			:				str			,       __lowerCamelCase			:				dict[str, str]				):







   '''simple docstring'''




   return "".join(cipher_map.get(__lowerCamelCase			,       __lowerCamelCase				) for ch in message.upper()				)





def lowerCamelCase__     (		__lowerCamelCase			:				str			,       __lowerCamelCase			:				dict[str, str]				):







   '''simple docstring'''




   _UpperCAmelCase  :  List[str]				       ={v: k for k, v in cipher_map.items()}
   return "".join(rev_cipher_map.get(__lowerCamelCase			,       __lowerCamelCase				) for ch in message.upper()				)





def lowerCamelCase__     (		):







   '''simple docstring'''




   _UpperCAmelCase  :  Union[str, Any]				       =input('Enter message to encode or decode: '				).strip()
   _UpperCAmelCase  :  int				       =input('Enter keyword: '				).strip()
   _UpperCAmelCase  :  int				       =input('Encipher or decipher? E/D:'				).strip()[0].lower()
   try:
      _UpperCAmelCase  :  Tuple				       ={'e': encipher, 'd': decipher}[option]
   except KeyError:
      raise KeyError('invalid input option'				)
   _UpperCAmelCase  :  List[str]				       =create_cipher_map(__lowerCamelCase				)
   print(func(__lowerCamelCase			,       __lowerCamelCase				)				)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()

