def calculate_cubic_bezier(points, t):
    """
    Points is a list of four points, P0, P1, P2 and P3, in that order
    """
    P0, P1, P2, P3 = points
    Bt = (1 - t) ** 3 * P0 + 3 * (1 - t) ** 2 * t * P1 + 3 * (1 - t
        ) * t ** 2 * P2 + t ** 3 * P3
    return Bt
