def gen_linedata(x0, y0, x1, y1):
    """
    Generate slope and y-intercept for two points
    """
    slope = (y1 - y0) / (x1 - x0)
    intercept = (x1 * y0 - x0 * y1) / (x1 - x0)
    return (slope, intercept)