import math


def haversine_distance(lat1, lat2, long1, long2):
	"""
		:param lat1: Point 1's latitude
		:param lat2: Point 2's latitude
		:param long1: Point 1's longitude
		:param long2: Point 2's longitude
		
	Description:
		The function returns the haversine (big circle) distances from the two points on earth. Does not take into account elevation change.
	"""
	radius = 6371000				#Radius of the earth (meters)
	lat1r = math.radians(lat1)
	lat2r = math.radians(lat2)
	long1r = math.radians(long1)
	long2r = math.radians(long2)
	deltaLat = lat2r-lat1r
	deltaLong = long2r - long1r
	
	a = (math.sin(deltaLat/2)*math.sin(deltaLat/2)) + math.cos(lat1r)*math.cos(lat2r)*(math.sin(deltaLong)*math.sin(deltaLong))
	c = 2*math.atan2(math.sqrt(a), math.sqrt(1-a))
	return radius*c