def get_line_params(x0, y0, x1, y1, norm=False):
    """
    Return A,B,C where the line from (x0,y0) to
    (x1,y1) is Ax + By + C = 0

    set norm=True to get the unit vector of the
    normal
    """
    A = y1 - y0
    B = -(x1 - x0)
    C = x1 * y0 - y1 * x0

    if norm:
        n = (A ** 2 + B ** 2) ** 0.5
        return A, B, C, n
    else:
        return A, B, C