






"""simple docstring"""






UpperCAmelCase_     :				Any         =				"""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""



def       _A    ()				-> None:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	input('''Enter message: '''							)
    SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	input('''Enter key [alphanumeric]: '''							)
    SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	input('''Encrypt/Decrypt [e/d]: '''							)

    if mode.lower().startswith('''e'''							):
        SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	'''encrypt'''
        SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	encrypt_message(__a					,       __a							)
    elif mode.lower().startswith('''d'''							):
        SCREAMING_SNAKE_CASE_   :						str							=	'''decrypt'''
        SCREAMING_SNAKE_CASE_   :						Optional[int]							=	decrypt_message(__a					,       __a							)

    print(f'\n{mode.title()}ed message:'							)
    print(__a							)



def       _A    (__a					,       __a							)				-> str:
    """simple docstring"""






    return translate_message(__a					,       __a					,       '''encrypt'''							)



def       _A    (__a					,       __a							)				-> str:
    """simple docstring"""






    return translate_message(__a					,       __a					,       '''decrypt'''							)



def       _A    (__a					,       __a					,       __a							)				-> str:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						str							=	[]
    SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	0
    SCREAMING_SNAKE_CASE_   :						Optional[int]							=	key.upper()

    for symbol in message:
        SCREAMING_SNAKE_CASE_   :						str							=	LETTERS.find(symbol.upper()							)
        if num != -1:
            if mode == "encrypt":
                num += LETTERS.find(key[key_index]							)
            elif mode == "decrypt":
                num -= LETTERS.find(key[key_index]							)

            num %= len(__a							)

            if symbol.isupper():
                translated.append(LETTERS[num]							)
            elif symbol.islower():
                translated.append(LETTERS[num].lower()							)

            key_index += 1
            if key_index == len(__a							):
                SCREAMING_SNAKE_CASE_   :						Dict							=	0
        else:
            translated.append(__a							)
    return "".join(__a							)


if __name__ == "__main__":
  main()










"""simple docstring"""






from __future__ import annotations

from numpy import array, cos, cross, floataa, radians, sin
from numpy.typing import NDArray



def       _A    (__a					,       __a					,       __a = False							)				-> list[float]:
    """simple docstring"""






    if radian_mode:
        return [magnitude * cos(__a							), magnitude * sin(__a							)]
    return [magnitude * cos(radians(__a							)							), magnitude * sin(radians(__a							)							)]



def       _A    (__a					,       __a					,       __a = 10**-1							)				-> bool:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_   :						NDArray[floataa]							=	cross(__a					,       __a							)
    SCREAMING_SNAKE_CASE_   :						float							=	sum(__a							)
    return abs(__a							) < eps


if __name__ == "__main__":
  # Test to check if it works
  UpperCAmelCase_     :				Union[str, Any]         =				array(
      [
          polar_force(7_1_8.4, 180 - 30),
          polar_force(8_7_9.5_4, 45),
          polar_force(100, -90),
      ]
  )

  UpperCAmelCase_     :				NDArray[floataa]         =				array([[0, 0], [0, 0], [0, 0]])

  assert in_static_equilibrium(forces, location)

  # Problem 1 in image_data/2D_problems.jpg
  UpperCAmelCase_     :				Union[str, Any]         =				array(
      [
          polar_force(30 * 9.8_1, 15),
          polar_force(215, 180 - 45),
          polar_force(264, 90 - 30),
      ]
  )

  UpperCAmelCase_     :				Optional[int]         =				array([[0, 0], [0, 0], [0, 0]])

  assert in_static_equilibrium(forces, location)

  # Problem in image_data/2D_problems_1.jpg
  UpperCAmelCase_     :				List[str]         =				array([[0, -2000], [0, -1200], [0, 15600], [0, -12400]])

  UpperCAmelCase_     :				Any         =				array([[0, 0], [6, 0], [10, 0], [12, 0]])

  assert in_static_equilibrium(forces, location)

  import doctest

  doctest.testmod()


