

'''simple docstring'''





from __future__ import annotations

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






def 							_lowerCAmelCase (      __magic_name__	:    float      ,   __magic_name__	:    float      ,   __magic_name__	:    bool = False	)							->     list[float]:
						if radian_mode:
												return [magnitude * cos(__magic_name__	), magnitude * sin(__magic_name__	)]
						return [magnitude * cos(radians(__magic_name__	)	), magnitude * sin(radians(__magic_name__	)	)]






def 							_lowerCAmelCase (      __magic_name__	:    NDArray[floataa]      ,   __magic_name__	:    NDArray[floataa]      ,   __magic_name__	:    float = 10**-1	)							->     bool:
						lowercase   :       NDArray[floataa]								=cross(__magic_name__      ,   __magic_name__	)
						lowercase   :       float								=sum(__magic_name__	)
						return abs(__magic_name__	) < eps


if __name__ == "__main__":
							# Test to check if it works
							UpperCamelCase_							=					array(
							    [
							        polar_force(7_18.4, 180 - 30),
							        polar_force(8_79.54, 45),
							        polar_force(100, -90),
							    ]
							)

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

							assert in_static_equilibrium(forces, location)

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

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

							assert in_static_equilibrium(forces, location)

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

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

							assert in_static_equilibrium(forces, location)

							import doctest

							doctest.testmod()








'''simple docstring'''





from __future__ import annotations






def 							_lowerCAmelCase (      __magic_name__	:    list[list[int]]	)							->     bool:
						lowercase   :       str								=len(__magic_name__	)
						# We need to create solution object to save path.
						lowercase   :       int								=[[0 for _ in range(__magic_name__	)] for _ in range(__magic_name__	)]
						lowercase   :       List[Any]								=run_maze(__magic_name__      ,   0      ,   0      ,   __magic_name__	)
						if solved:
												print('''\n'''.join(str(__magic_name__	) for row in solutions	)	)
						else:
												print('''No solution exists!'''	)
						return solved






def 							_lowerCAmelCase (      __magic_name__	:    list[list[int]]      ,   __magic_name__	:    int      ,   __magic_name__	:    int      ,   __magic_name__	:    list[list[int]]	)							->     bool:
						lowercase   :       Optional[int]								=len(__magic_name__	)
						# Final check point.
						if i == j == (size - 1):
												lowercase   :       Optional[int]								=1
												return True

						lowercase   :       Optional[int]								=(not i < 0) and (not j < 0)  # Check lower bounds
						lowercase   :       Tuple								=(i < size) and (j < size)  # Check upper bounds

						if lower_flag and upper_flag:
												# check for already visited and block points.
												lowercase   :       Union[str, Any]								=(not solutions[i][j]) and (not maze[i][j])
												if block_flag:
																		# check visited
																		lowercase   :       Union[str, Any]								=1

																		# check for directions
																		if (
																		    run_maze(__magic_name__      ,   i + 1      ,   __magic_name__      ,   __magic_name__	)
																		    or run_maze(__magic_name__      ,   __magic_name__      ,   j + 1      ,   __magic_name__	)
																		    or run_maze(__magic_name__      ,   i - 1      ,   __magic_name__      ,   __magic_name__	)
																		    or run_maze(__magic_name__      ,   __magic_name__      ,   j - 1      ,   __magic_name__	)
																		):
																								return True

																		lowercase   :       str								=0
																		return False
						return False


if __name__ == "__main__":
							import doctest

							doctest.testmod()





