import math


def calc_gps_distance(lat1, long1, lat2, long2):
    """
    All calculations need to be done in radians, instead of degrees. Since most 
    GPS coordinates tend to use degrees, we convert to radians first, and then 
    use the Haversine formula. The Haversine formula gives the shortest 
    great-circle distance between any two points, i.e. as-the-crow-flies 
    distance using a reasonably focussed crow

    WARNING: The calculation is done in Kilometres. But, at the street level,
    kilometres is not useful. So, we convert to metres and return!

    >>> calc_gps_distance(53.34376885732333,-6.240988668839767,53.34376349, \
            -6.24099402)
    0000.6945396560484981

    >>> calc_gps_distance(53.34376885732333,-6.240988668839767,0,0)
    5959609.740337647

    >>> calc_gps_distance(90,0,0,0)
    10007543.398

    """
    radius_of_earth = 6371 # in Kilometres

    delta_latitude = math.radians(lat2 - lat1)
    delta_longitude = math.radians(long2 - long1)
    rad_lat1 = math.radians(lat1)
    rad_lat2 = math.radians(lat2)

    a = math.sin(delta_latitude / 2) * math.sin(delta_latitude / 2) + \
        math.cos(rad_lat1) * math.cos(rad_lat2) * math.sin(delta_longitude / 2) \
        * math.sin(delta_longitude / 2)

    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))

    distance = radius_of_earth * c
    distance_in_metres = distance * 1000
    return distance_in_metres