import math


def get_cross_points(a, b, c, image_height):
    """
    solve the quadratic equation x = ay^2 + by + c

    Parameters
    ----------
    a: the first coefficient of quadratic equation
    b: the second coefficient of quadratic equation
    c: the third coefficient of quadratic equation
    image_height: the height of image

    Return
    ----------
    (number of cross_points, cross_points)

    """

    assert a
    d = b**2 - 4*a*c
    if d < 0:
        return (0, None)
    elif d == 0:
        y = -b / (2 * a)
        if (y < image_height) and (y >= 0):
            return (0, y)
        else:
            return (0, None)
    else:
        y1 = (-b + math.sqrt(d)) / (2 * a)
        y2 = (-b - math.sqrt(d)) / (2 * a)
        if (y1 < image_height) and (y1 >= 0) and (y2 < image_height) and (y2 >= 0) :
            return (2,(y1, y2))
        elif (y1 < image_height) and (y1 >= 0):
            return (1, y1)
        elif (y2 < image_height) and (y2 >= 0):
            return (1, y2)
        else:
            return (0, None)