import math


def getDistance(long1,
                lat1,
                long2,
                lat2):
    """    getDistance(long1, lat1, long2, lat2)

    Get distance betwen 2 coordinates in log/lat.
    
    Parameters
    ----------
    long1 : float
        Longitude 1st coordinate.
    lat1 : float
            Latitude 1st coordinate.
    long2 : float
            Longitude 2nd coordinate.  
    lat2 : float
            Latitude 2nd coordinate.
    Returns
    -------
    float
    Get the value of the distance.
    """
    
    
    r = 6371000 #radio terrestre medio, en metros 
    c = math.pi/180 #constante para transformar grados en radianes

    #Haversine distance
    return 2*r*math.asin(math.sqrt(
            math.sin(c*(lat2-lat1)/2)**2
            + math.cos(c*lat1)*math.cos(c*lat2)
            * math.sin(c*(long2-long1)/2)**2))