(a, b, c, x0, y0)
return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)
Return the distance to a line ax + by + c = 0
Return the distance to a line ax + by + c = 0
Return the distance to a line ax + by + c = 0
def distance_to_line(a, b, c, x0, y0):
    """
    Return the distance to a line ax + by + c = 0
    """
    assert a != 0 or b != 0
    return np.abs(a * x0 + b * y0 + c) / np.sqrt(a ** 2 + b ** 2)
def distance_to_line ( a , b , c , x0 , y0 ) : assert a != 0 or b != 0 return np . abs ( a * x0 + b * y0 + c ) / np . sqrt ( a ** 2 + b ** 2 )