





"""simple docstring"""





from __future__ import annotations

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


def 			UpperCAmelCase__							(  SCREAMING_SNAKE_CASE     :						float							,						SCREAMING_SNAKE_CASE     :						float							,						SCREAMING_SNAKE_CASE     :						bool = False			):







      '''simple docstring'''




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


def 			UpperCAmelCase__							(  SCREAMING_SNAKE_CASE     :						NDArray[floataa]							,						SCREAMING_SNAKE_CASE     :						NDArray[floataa]							,						SCREAMING_SNAKE_CASE     :						float = 10**-1			):







      '''simple docstring'''




      lowerCAmelCase  						=       cross(SCREAMING_SNAKE_CASE							,						SCREAMING_SNAKE_CASE			)
      lowerCAmelCase  						=       sum(SCREAMING_SNAKE_CASE			)
      return abs(SCREAMING_SNAKE_CASE			) < eps


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

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

       assert in_static_equilibrium(forces, location)

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

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

       assert in_static_equilibrium(forces, location)

       # Problem in image_data/2D_problems_1.jpg
       SCREAMING_SNAKE_CASE__					=   array([[0, -2_000], [0, -1_200], [0, 15_600], [0, -12_400]])

       SCREAMING_SNAKE_CASE__					=   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

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE__					=   {"configuration_focalnet": ["FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FocalNetConfig"]}


try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       SCREAMING_SNAKE_CASE__					=   [
           "FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST",
           "FocalNetForImageClassification",
           "FocalNetForMaskedImageModeling",
           "FocalNetBackbone",
           "FocalNetModel",
           "FocalNetPreTrainedModel",
       ]

if TYPE_CHECKING:
       from .configuration_focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_focalnet import (
                  FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST,
                  FocalNetBackbone,
                  FocalNetForImageClassification,
                  FocalNetForMaskedImageModeling,
                  FocalNetModel,
                  FocalNetPreTrainedModel,
              )

else:
       import sys

       SCREAMING_SNAKE_CASE__					=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






