def kochanekBartelsInterpolator(v0, v1, v2, v3, alpha, tension, continuity, bias):
    """
    Kochanek-Bartels interpolator. Allows even better control of the bends in the spline by providing three
    parameters to adjust them:
    
    * tension: 1 for high tension, 0 for normal tension and -1 for low tension.
    * continuity: 1 for inverted corners, 0 for normal corners, -1 for box corners.
    * bias: 1 for bias towards the next segment, 0 for even bias, -1 for bias towards the previous segment.
    
    Using 0 continuity gives a hermite spline.
    """
    alpha2 = alpha * alpha
    alpha3 = alpha2 * alpha
    m0 = ((((v1 - v0) * (1 - tension)) * (1 + continuity)) * (1 + bias)) / 2.0
    m0 += ((((v2 - v1) * (1 - tension)) * (1 - continuity)) * (1 - bias)) / 2.0
    m1 = ((((v2 - v1) * (1 - tension)) * (1 - continuity)) * (1 + bias)) / 2.0
    m1 += ((((v3 - v2) * (1 - tension)) * (1 + continuity)) * (1 - bias)) / 2.0
    a0 = 2 * alpha3 - 3 * alpha2 + 1
    a1 = alpha3 - 2 * alpha2 + alpha
    a2 = alpha3 - alpha2
    a3 = -2 * alpha3 + 3 * alpha2

    return a0 * v1 + a1 * m0 + a2 * m1 + a3 * v2