import math


def signed_distance_point_to_line(a, b, c, p):
    """
    Distance between a point p and a line defined by a, b and c.

    a, b, c: the line $x + by + c = 0$
    p: the point
    """
    d1 = (a*p[0] + b*p[1] + c)
    d2 = math.sqrt(math.pow(a, 2.) + math.pow(b, 2.))
    #d = abs(d1)/d2
    d = d1/d2
    return d