



from __future__ import annotations

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



def __lowerCAmelCase (     SCREAMING_SNAKE_CASE_     :   float						,  SCREAMING_SNAKE_CASE_     :   float						,  SCREAMING_SNAKE_CASE_     :   bool = False  ):
			if radian_mode:
						return [magnitude * cos(SCREAMING_SNAKE_CASE_  ), magnitude * sin(SCREAMING_SNAKE_CASE_  )]
			return [magnitude * cos(radians(SCREAMING_SNAKE_CASE_  )  ), magnitude * sin(radians(SCREAMING_SNAKE_CASE_  )  )]



def __lowerCAmelCase (     SCREAMING_SNAKE_CASE_     :   NDArray[floataa]						,  SCREAMING_SNAKE_CASE_     :   NDArray[floataa]						,  SCREAMING_SNAKE_CASE_     :   float = 10**-1  ):
			lowercase__					  =				cross(SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_  )
			lowercase__					  =				sum(SCREAMING_SNAKE_CASE_  )
			return abs(SCREAMING_SNAKE_CASE_  ) < eps


if __name__ == "__main__":
							# Test to check if it works
							lowercase_								=     array(
							    [
							        polar_force(718.4, 180 - 30),
							        polar_force(879.54, 45),
							        polar_force(100, -90),
							    ]
							)

							lowercase_								=     array([[0, 0], [0, 0], [0, 0]])

							assert in_static_equilibrium(forces, location)

							# Problem 1 in image_data/2D_problems.jpg
							lowercase_								=     array(
							    [
							        polar_force(30 * 9.81, 15),
							        polar_force(215, 180 - 45),
							        polar_force(264, 90 - 30),
							    ]
							)

							lowercase_								=     array([[0, 0], [0, 0], [0, 0]])

							assert in_static_equilibrium(forces, location)

							# Problem in image_data/2D_problems_1.jpg
							lowercase_								=     array([[0, -2000], [0, -1200], [0, 1_5600], [0, -1_2400]])

							lowercase_								=     array([[0, 0], [6, 0], [10, 0], [12, 0]])

							assert in_static_equilibrium(forces, location)

							import doctest

							doctest.testmod()









def __lowerCAmelCase (     SCREAMING_SNAKE_CASE_  ):
			lowercase__					  =				0
			for ch in input_str:
						lowercase__					  =				ord(SCREAMING_SNAKE_CASE_  )
						lowercase__					  =				pow(2						,  SCREAMING_SNAKE_CASE_  )

						# If we already turned on bit for current character's unicode
						if bitmap >> ch_unicode & 1 == 1:
									return False
						bitmap |= ch_bit_index_on
			return True


if __name__ == "__main__":
							import doctest

							doctest.testmod()




