def get_intersect_point(a1, b1, c1, d1, x0, y0):
    """Get the point on the lines that passes through (a1,b1) and (c1,d1) and s closest to the point (x0,y0)."""
    a = 0
    if (a1 - c1) != 0:
        a = float(b1 - d1) / float(a1 - c1)
    c = b1 - a * a1

    # Compute the line perpendicular to the line of the OF vector that passes throught (x0,y0)
    a_aux = 0
    if a != 0:
        a_aux = -1 / a
    c_aux = y0 - a_aux * x0

    # Get intersection of the two lines
    x1 = (c_aux - c) / (a - a_aux)
    y1 = a_aux * x1 + c_aux

    return (x1, y1)