public double getPos(double p, int splineNumber) {
        double pos = p * mTotalLength;
        double sum = 0;
        int k = 0;
        for (; k < mCurveLength.length - 1 && mCurveLength[k] < pos; k++) {
            pos -= mCurveLength[k];
        }
        return mCurve[splineNumber][k].eval(pos / mCurveLength[k]);
    }
Spline in N dimensions

@param points [mPoints][dimensionality]
ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/HyperSpline.java