



'''simple docstring'''





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

from .haversine_distance import haversine_distance

lowercase_	 =						6_378_137.0
lowercase_	 =						6_356_752.314_245
lowercase_	 =						6_378_137




def lowerCAmelCase						(__A						,			__A						,			__A						,			__A):



					"""simple docstring"""



					_a											=						(AXIS_A - AXIS_B) / AXIS_A
					# Parametric latitudes
					# https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
					_a											=						atan((1 - flattening) * tan(radians(lowerCamelCase__)))
					_a											=						atan((1 - flattening) * tan(radians(lowerCamelCase__)))

					# Compute central angle between two points
					# using haversine theta. sigma =  haversine_distance / equatorial radius
					_a											=						haversine_distance(lowerCamelCase__						,			lowerCamelCase__						,			lowerCamelCase__						,			lowerCamelCase__) / EQUATORIAL_RADIUS

					# Intermediate P and Q values
					_a											=						(b_lata + b_lata) / 2
					_a											=						(b_lata - b_lata) / 2

					# Intermediate X value
					# X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
					_a											=						(sin(lowerCamelCase__) ** 2) * (cos(lowerCamelCase__) ** 2)
					_a											=						cos(sigma / 2) ** 2
					_a											=						(sigma - sin(lowerCamelCase__)) * (x_numerator / x_demonimator)

					# Intermediate Y value
					# Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
					_a											=						(cos(lowerCamelCase__) ** 2) * (sin(lowerCamelCase__) ** 2)
					_a											=						sin(sigma / 2) ** 2
					_a											=						(sigma + sin(lowerCamelCase__)) * (y_numerator / y_denominator)

					return EQUATORIAL_RADIUS * (sigma - ((flattening / 2) * (x_value + y_value)))


if __name__ == "__main__":
		import doctest

		doctest.testmod()








'''simple docstring'''





def lowerCAmelCase						(__A):



     """simple docstring"""



     _a											=						set()
     # To detect a back edge, keep track of vertices currently in the recursion stack
     _a											=						set()
     return any(
         node not in visited and depth_first_search(__A						,			__A						,			__A						,			__A)
         for node in graph)




def lowerCAmelCase						(__A						,			__A						,			__A						,			__A):



     """simple docstring"""



     visited.add(__A)
     rec_stk.add(__A)

     for node in graph[vertex]:
          if node not in visited:
               if depth_first_search(__A						,			__A						,			__A						,			__A):
                    return True
          elif node in rec_stk:
               return True

    # The node needs to be removed from recursion stack before function ends
     rec_stk.remove(__A)
     return False


if __name__ == "__main__":
  from doctest import testmod

  testmod()



