public void setup(double[][] points) {
        mDimensionality = points[0].length;
        mPoints = points.length;
        mCtl = new double[mDimensionality][mPoints];
        mCurve = new Cubic[mDimensionality][];
        for (int d = 0; d < mDimensionality; d++) {
            for (int p = 0; p < mPoints; p++) {
                mCtl[d][p] = points[p][d];
            }
        }

        for (int d = 0; d < mDimensionality; d++) {
            mCurve[d] = calcNaturalCubic(mCtl[d].length, mCtl[d]);
        }

        mCurveLength = new double[mPoints - 1];
        mTotalLength = 0;
        Cubic[] temp = new Cubic[mDimensionality];
        for (int p = 0; p < mCurveLength.length; p++) {
            for (int d = 0; d < mDimensionality; d++) {

                temp[d] = mCurve[d][p];

            }
            mTotalLength += mCurveLength[p] = approxLength(temp);
        }
    }
Spline in N dimensions

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