(p1, p2=None, decimal=False)
return int(round(distance))
Find the distance between two (x, y) coordinates.
Find the distance between two (x, y) coordinates.
Find the distance between two ( x y ) coordinates .
def find_distance(p1, p2=None, decimal=False):
    """Find the distance between two (x, y) coordinates."""
    if p2 is None:
        return (0, 0.0)[decimal]
    distance = ((p2[0] - p1[0]) ** 2 + (p2[1] - p1[1]) ** 2) ** 0.5
    if decimal:
        return distance
    return int(round(distance))
def find_distance ( p1 , p2 = None , decimal = False ) : if p2 is None : return ( 0 , 0.0 ) [ decimal ] distance = ( ( p2 [ 0 ] - p1 [ 0 ] ) ** 2 + ( p2 [ 1 ] - p1 [ 1 ] ) ** 2 ) ** 0.5 if decimal : return distance return int ( round ( distance ) )