def line_coeff_from_segment(point_a, point_b):
    """Given a line segment (two points), find the slope (m) and y-intercept (b) of line y=mx+b

    Parameters
    ----------
    point_a : tuple
        coordinates of the first point
    
    point_b : tuple
        coordinates of the second point

    Return
    ------
    m : float
        the line's slope

    b : float
        the line's y-intercept

    Examples
    --------
    Find the slope and y-intercept of a line defined by points (8, 3) and (-1, 10)

    .. code-block:: python

        import cloudburst as cb
        (m, b) = cb.line_coeff_from_segment((8, 3), (-1, 10))
        print("line: y={}x+{}".format(m, b))
    """
    m = (point_b[1] - point_a[1]) / (point_b[0] - point_a[0])
    b = point_a[1] - m * point_a[0]
    return m, b
