import math


def dist_of_pt_to_line(pt, A, B, C):
    """
    2D space point to line distance
    """
    # tmp = abs(A*pt[0] + B*pt[1] + C) / math.sqrt(A*A + B*B)
    tmp = -(A*pt[0] + B*pt[1] + C) / math.sqrt(A*A + B*B)

    return tmp
    # return math.sqrt(tmp * tmp)