

'''simple docstring'''

from __future__ import annotations

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

def 					__UpperCamelCase				(						lowercase__    :	float,       lowercase__    :	float,       lowercase__    :	bool = False			):






     '''simple docstring'''





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

def 					__UpperCamelCase				(						lowercase__    :	NDArray[floataa],       lowercase__    :	NDArray[floataa],       lowercase__    :	float = 10**-1			):






     '''simple docstring'''





     __lowercase      		=cross(lowercase__,       lowercase__			)
     __lowercase      		=sum(lowercase__			)
     return abs(lowercase__			) < eps


if __name__ == "__main__":
       # Test to check if it works
       UpperCAmelCase					 =	array(
           [
               polar_force(718.4, 180 - 30),
               polar_force(879.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, 1_5600], [0, -1_2400]])

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

       assert in_static_equilibrium(forces, location)

       import doctest

       doctest.testmod()






"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__snake_case       =       {
    """configuration_poolformer""": [
        """POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """PoolFormerConfig""",
        """PoolFormerOnnxConfig""",
    ]
}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __snake_case       =       ["""PoolFormerFeatureExtractor"""]
  __snake_case       =       ["""PoolFormerImageProcessor"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __snake_case       =       [
      """POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """PoolFormerForImageClassification""",
      """PoolFormerModel""",
      """PoolFormerPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_poolformer import (
      POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
      PoolFormerConfig,
      PoolFormerOnnxConfig,
  )

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_poolformer import PoolFormerFeatureExtractor
    from .image_processing_poolformer import PoolFormerImageProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_poolformer import (
        POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        PoolFormerForImageClassification,
        PoolFormerModel,
        PoolFormerPreTrainedModel,
    )


else:
  import sys

  __snake_case       =       _LazyModule(__name__, globals()["""__file__"""], _import_structure)





