



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

_lowercase						  =		6_378_137.0
_lowercase						  =		6_356_752.314_245
_lowercase						  =		6378137



def 		lowerCAmelCase__    (					UpperCamelCase_				:       float ,       UpperCamelCase_				:       float ,       UpperCamelCase_				:       float ,       UpperCamelCase_				:       float	)->  float:
    A__		 =					(AXIS_A - AXIS_B) / AXIS_A
    A__		 =					atan((1 - flattening) * tan(radians(UpperCamelCase_	)	)	)
    A__		 =					atan((1 - flattening) * tan(radians(UpperCamelCase_	)	)	)
    A__		 =					radians(UpperCamelCase_	)
    A__		 =					radians(UpperCamelCase_	)
    # Equation
    A__		 =					sin((phi_a - phi_a) / 2	)
    A__		 =					sin((lambda_a - lambda_a) / 2	)
    # Square both values
    sin_sq_phi *= sin_sq_phi
    sin_sq_lambda *= sin_sq_lambda
    A__		 =					sqrt(sin_sq_phi + (cos(UpperCamelCase_	) * cos(UpperCamelCase_	) * sin_sq_lambda)	)
    return 2 * RADIUS * asin(UpperCamelCase_	)


if __name__ == "__main__":
   import doctest

   doctest.testmod()





from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowercase						  =		logging.get_logger(__name__)



class     _UpperCAmelCase			(       A__     ):
     UpperCamelCase__		    =				'''timm_backbone'''




     def __init__(				self ,						a__=None ,						a__=3 ,						a__=True ,						a__=True ,						a__=None ,						**a__ ,						):
         super().__init__(**a__)
         A__		 =					backbone
         A__		 =					num_channels
         A__		 =					features_only
         A__		 =					use_pretrained_backbone
         A__		 =					True
         A__		 =					out_indices if out_indices is not None else (-1,)
