"""simple docstring"""


from collections.abc import Callable





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase  ,       __lowerCAmelCase							)				->   float:




						'''simple docstring'''



						lowerCamelCase__   =a
						lowerCamelCase__   =b
						if function(__lowerCAmelCase							) == 0:  # one of the a or b is a root for the function
												return a
						elif function(__lowerCAmelCase							) == 0:
												return b
						elif (
						    function(__lowerCAmelCase							) * function(__lowerCAmelCase							) > 0
						):  # if none of these are root and they are both positive or negative,
												# then this algorithm can't find the root
												raise ValueError("could not find root in given interval."							)
						else:
												lowerCamelCase__   =start + (end - start) / 2.0
												while abs(start - mid							) > 10**-7:  # until precisely equals to 10^-7
																		if function(__lowerCAmelCase							) == 0:
																								return mid
																		elif function(__lowerCAmelCase							) * function(__lowerCAmelCase							) < 0:
																								lowerCamelCase__   =mid
																		else:
																								lowerCamelCase__   =mid
																		lowerCamelCase__   =start + (end - start) / 2.0
												return mid





def      lowerCamelCase_					(   __lowerCAmelCase							)				->   float:




						'''simple docstring'''



						return x**3 - 2 * x - 5


if __name__ == "__main__":
	print(bisection(f, 1, 1000))

	import doctest

	doctest.testmod()



"""simple docstring"""


from __future__ import annotations

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





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase  ,       __lowerCAmelCase = False							)				->   list[float]:




						'''simple docstring'''



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





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase  ,       __lowerCAmelCase = 10**-1							)				->   bool:




						'''simple docstring'''



						lowerCamelCase__   =cross(__lowerCAmelCase  ,       __lowerCAmelCase							)
						lowerCamelCase__   =sum(__lowerCAmelCase							)
						return abs(__lowerCAmelCase							) < eps


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

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

	assert in_static_equilibrium(forces, location)

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

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

	assert in_static_equilibrium(forces, location)

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

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

	assert in_static_equilibrium(forces, location)

	import doctest

	doctest.testmod()


