






# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

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


snake_case     					=		{
    """configuration_vivit""": ["""VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """VivitConfig"""],
}
try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   snake_case     					=		["""VivitImageProcessor"""]


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   snake_case     					=		[
       """VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """VivitModel""",
       """VivitPreTrainedModel""",
       """VivitForVideoClassification""",
   ]


if TYPE_CHECKING:
   from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .image_processing_vivit import VivitImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_vivit import (
          VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
          VivitForVideoClassification,
          VivitModel,
          VivitPreTrainedModel,
      )


else:
   import sys

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







"""simple docstring"""


from __future__ import annotations

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






def      __UpperCAmelCase       (      lowercase ,lowercase ,lowercase = 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 ,lowercase ,lowercase = 10**-1		):







  """simple docstring"""
  _UpperCAmelCase    			=   cross(lowercase ,lowercase		)
  _UpperCAmelCase    			=   sum(lowercase		)
  return abs(lowercase		) < eps


if __name__ == "__main__":
    # Test to check if it works
    UpperCAmelCase__			=    array(
        [
            polar_force(718.4, 1_8_0 - 3_0),
            polar_force(879.54, 4_5),
            polar_force(1_0_0, -9_0),
        ]
    )

    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(3_0 * 9.81, 1_5),
            polar_force(2_1_5, 1_8_0 - 4_5),
            polar_force(2_6_4, 9_0 - 3_0),
        ]
    )

    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, -2_0_0_0], [0, -1_2_0_0], [0, 1_5_6_0_0], [0, -1_2_4_0_0]])

    UpperCAmelCase__			=    array([[0, 0], [6, 0], [1_0, 0], [1_2, 0]])

    assert in_static_equilibrium(forces, location)

    import doctest

    doctest.testmod()
