def bezier_point(p0:float, p1:float, p2:float, p3:float, t:float):
    """
    Calculate the position of a point with parameter t on the cubic bezier curve.

    Note that the parameter t must >=0 and <=1 .

    :param p0: position of the first control point
    :param p1: position of the second control point
    :param p2: position of the third control point
    :param p3: position of the forth control point
    :param t: the parameter t
    :return: position of the point
    """
    if t<0 or t>1:
        raise ValueError("t must in [0..1]")
    return (1-t) ** 3 * p0 + 3 * (1 - t) ** 2 * t * p1 + 3 * (1 - t) * t ** 2 * p2 + t ** 3 * p3