


from math import asin, atan, cos, radians, sin, sqrt, tan

UpperCAmelCase    =					6_378_137.0
UpperCAmelCase    =					6_356_752.314_245
UpperCAmelCase    =					637_8137






def  __lowerCAmelCase					(SCREAMING_SNAKE_CASE      ,      SCREAMING_SNAKE_CASE      ,      SCREAMING_SNAKE_CASE      ,      SCREAMING_SNAKE_CASE      )->						float:




      """simple docstring"""

      snake_case_ =   (AXIS_A - AXIS_B) / AXIS_A
      snake_case_ =   atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE      )      )      )
      snake_case_ =   atan((1 - flattening) * tan(radians(SCREAMING_SNAKE_CASE      )      )      )
      snake_case_ =   radians(SCREAMING_SNAKE_CASE      )
      snake_case_ =   radians(SCREAMING_SNAKE_CASE      )
      # Equation
      snake_case_ =   sin((phi_a - phi_a) / 2      )
      snake_case_ =   sin((lambda_a - lambda_a) / 2      )
      # Square both values
      sin_sq_phi *= sin_sq_phi
      sin_sq_lambda *= sin_sq_lambda
      snake_case_ =   sqrt(sin_sq_phi + (cos(SCREAMING_SNAKE_CASE      ) * cos(SCREAMING_SNAKE_CASE      ) * sin_sq_lambda)      )
      return 2 * RADIUS * asin(SCREAMING_SNAKE_CASE      )


if __name__ == "__main__":
   import doctest

   doctest.testmod()



from ...utils import is_note_seq_available, is_transformers_available, is_torch_available
from ...utils import OptionalDependencyNotAvailable


try:
   if not (is_transformers_available() and is_torch_available()):
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
   from .notes_encoder import SpectrogramNotesEncoder
   from .continous_encoder import SpectrogramContEncoder
   from .pipeline_spectrogram_diffusion import (
       SpectrogramContEncoder,
       SpectrogramDiffusionPipeline,
       TaFilmDecoder,
   )

try:
   if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ...utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
   from .midi_utils import MidiProcessor