@staticmethod
def _cubic_bezier(p, t):
    """
        Returns a float representing the point along the cubic bezier curve in the given dimension.

        Takes ordered list of 4 control points [P0, P1, P2, P3] and parametric parameter t where 0 <= t <= 1

        implements explicit form of https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves
        """
    assert 0 <= t <= 1
    return (1.0 - t) ** 3 * p[0] + 3.0 * t * (1.0 - t) ** 2 * p[1
        ] + 3.0 * t ** 2 * (1.0 - t) * p[2] + t ** 3 * p[3]
