






def   a			(						lowerCamelCase_		,   lowerCamelCase_				):






				'''simple docstring'''
				return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2






def   a			(						lowerCamelCase_		,   lowerCamelCase_=0				):






				'''simple docstring'''
				return sorted(lowerCamelCase_		,   key=lambda lowerCamelCase_				: x[column]				)






def   a			(						lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_=float('''inf'''				)				):






				'''simple docstring'''

				for i in range(points_counts - 1				):
								for j in range(i + 1		,   lowerCamelCase_				):
												lowercase__    =			euclidean_distance_sqr(points[i]		,   points[j]				)
												if current_dis < min_dis:
																lowercase__    =			current_dis
				return min_dis






def   a			(						lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_=float('''inf'''				)				):






				'''simple docstring'''

				for i in range(min(6		,   points_counts - 1				)		,   lowerCamelCase_				):
								for j in range(max(0		,   i - 6				)		,   lowerCamelCase_				):
												lowercase__    =			euclidean_distance_sqr(points[i]		,   points[j]				)
												if current_dis < min_dis:
																lowercase__    =			current_dis
				return min_dis






def   a			(						lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_				):






				'''simple docstring'''

				# base case
				if points_counts <= 3:
								return dis_between_closest_pair(lowerCamelCase_		,   lowerCamelCase_				)

				# recursion
				lowercase__    =			points_counts // 2
				lowercase__    =			closest_pair_of_points_sqr(
				    lowerCamelCase_		,   points_sorted_on_y[:mid]		,   lowerCamelCase_				)
				lowercase__    =			closest_pair_of_points_sqr(
				    lowerCamelCase_		,   points_sorted_on_y[mid:]		,   points_counts - mid				)
				lowercase__    =			min(lowerCamelCase_		,   lowerCamelCase_				)
				lowercase__    =			[]
				for point in points_sorted_on_x:
								if abs(point[0] - points_sorted_on_x[mid][0]				) < closest_pair_dis:
												cross_strip.append(lowerCamelCase_				)

				lowercase__    =			dis_between_closest_in_strip(
				    lowerCamelCase_		,   len(lowerCamelCase_				)		,   lowerCamelCase_				)
				return min(lowerCamelCase_		,   lowerCamelCase_				)






def   a			(						lowerCamelCase_		,   lowerCamelCase_				):






				'''simple docstring'''
				lowercase__    =			column_based_sort(lowerCamelCase_		,   column=0				)
				lowercase__    =			column_based_sort(lowerCamelCase_		,   column=1				)
				return (
				    closest_pair_of_points_sqr(
				        lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_				)
				) ** 0.5


if __name__ == "__main__":
							A__	:			Dict			   = [(2, 3), (12, 30), (40, 50), (5, 1), (12, 10), (3, 4)]
							print('Distance:', closest_pair_of_points(points, len(points)))












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

A__	:			Optional[int]			   = 637_8137.0
A__	:			List[str]			   = 635_6752.31_4245
A__	:			Union[str, Any]			   = 6_37_81_37






def   a			(						lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_		,   lowerCamelCase_				):






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


if __name__ == "__main__":
							import doctest

							doctest.testmod()




