def cubicInterpolate(v0, v1, v2, v3, alpha):
    """
    Cubic interpolator. Gives better continuity along the spline than the cosine interpolator,
    however needs 4 points to interpolate.
    """
    alpha2 = alpha * alpha
    a0 = (v3 - v2) - v0 + v1
    a1 = (v0 - v1) - a0
    a2 = v2 - v0
    a3 = v1

    return (a0 * alpha) * alpha2 + a1 * alpha2 + a2 * alpha + a3