"""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()



"""simple docstring"""


def      lowerCamelCase_					(   __lowerCAmelCase							)				->   "list[int]":




						'''simple docstring'''



						if upper_limit < 0:
												raise ValueError("Limit for the Catalan sequence must be ≥ 0"							)

						lowerCamelCase__   =[0] * (upper_limit + 1)

						# Base case: C(0) = C(1) = 1
						lowerCamelCase__   =1
						if upper_limit > 0:
												lowerCamelCase__   =1

						# Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i
						for i in range(2  ,       upper_limit + 1							):
												for j in range(__lowerCAmelCase							):
																		catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]

						return catalan_list


if __name__ == "__main__":
	print('\n********* Catalan Numbers Using Dynamic Programming ************\n')
	print('\n*** Enter -1 at any time to quit ***')
	print('\nEnter the upper limit (≥ 0) for the Catalan number sequence: ', end='')
	try:
		while True:
			a				=int(input().strip())
			if N < 0:
				print('\n********* Goodbye!! ************')
				break
			else:
				print(F'''The Catalan numbers from 0 through {N} are:''')
				print(catalan_numbers(N))
				print('Try another upper limit for the sequence: ', end='')
	except (NameError, ValueError):
		print('\n********* Invalid input, goodbye! ************\n')

	import doctest

	doctest.testmod()


