def _distance ( coord1 , coord2 ) : xdist = coord1 [ 0 ] - coord2 [ 0 ] ydist = coord1 [ 1 ] - coord2 [ 1 ] return sqrt ( xdist * xdist + ydist * ydist )
calculate distance two points latitude longitude in python
Return the distance between two points coord1 and coord2 . These parameters are assumed to be ( x y ) tuples .
def _distance(coord1, coord2):
    """
    Return the distance between two points, `coord1` and `coord2`. These
    parameters are assumed to be (x, y) tuples.
    """
    xdist = coord1[0] - coord2[0]
    ydist = coord1[1] - coord2[1]
    return sqrt(xdist*xdist + ydist*ydist)