interpolation/Cubic/Vector

Summary

Function: vector vCub( vector a, vector b, vector c, vector d, float t );

Cubic interpolation between four vectors.
Returns a vector

• vector a
• vector b
• vector c
• vector d
• float t

Specification

vector vCub(vector a, vector b, vector c, vector d, float t) {
    float P = (d-c)-(a-b);
    return P*llPow(t,3) + ((a-b)-P)*llPow(t,2) + (c-a)*t + b;
}
// Released into public domain. By Nexii Malthus.

Examples