






class 				_A			:
    """simple docstring"""

    def __init__(				self      :     Optional[Any]      )      ->							Optional[Any]:
           __UpperCAmelCase     				={}



    def _a							(				self      :     str      )      ->							None:
           print(self.vertex      )
           for i in self.vertex:
                  print(__SCREAMING_SNAKE_CASE ,     """ -> """ ,     """ -> """.join([str(__SCREAMING_SNAKE_CASE      ) for j in self.vertex[i]]      )      )



    def _a							(				self      :     Optional[Any] ,     __SCREAMING_SNAKE_CASE      :     int ,     __SCREAMING_SNAKE_CASE      :     int      )      ->							None:
           # check if vertex is already present,
           if from_vertex in self.vertex:
                  self.vertex[from_vertex].append(__SCREAMING_SNAKE_CASE      )
           else:
                  # else make a new vertex
                  __UpperCAmelCase     				=[to_vertex]



    def _a							(				self      :     Tuple      )      ->							None:
           # visited array for storing already visited nodes
           __UpperCAmelCase     				=[False] * len(self.vertex      )

           # call the recursive helper function
           for i in range(len(self.vertex      )      ):
                  if not visited[i]:
                         self.dfs_recursive(__SCREAMING_SNAKE_CASE ,     __SCREAMING_SNAKE_CASE      )



    def _a							(				self      :     Any ,     __SCREAMING_SNAKE_CASE      :     int ,     __SCREAMING_SNAKE_CASE      :     list      )      ->							None:
           # mark start vertex as visited
           __UpperCAmelCase     				=True

           print(__SCREAMING_SNAKE_CASE ,     end=""" """      )

           # Recur for all the vertices that are adjacent to this node
           for i in self.vertex:
                  if not visited[i]:
                         self.dfs_recursive(__SCREAMING_SNAKE_CASE ,     __SCREAMING_SNAKE_CASE      )


if __name__ == "__main__":
   __A					=	Graph()
   g.add_edge(0, 1)
   g.add_edge(0, 2)
   g.add_edge(1, 2)
   g.add_edge(2, 0)
   g.add_edge(2, 3)
   g.add_edge(3, 3)

   g.print_graph()
   print("DFS:")
   g.dfs()

   # OUTPUT:
   # 0  ->  1 -> 2
   # 1  ->  2
   # 2  ->  0 -> 3
   # 3  ->  3
   # DFS:
   #  0 1 2 3





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


