/**
 *
 * @param {number[]} p0
 * @param {number[]} p1
 * @param {number} dimensions
 * @param {number} half_alpha between 0..0.5
 * @returns {number}
 */
export function catmull_rom_compute_T(p0, p1, dimensions, half_alpha) {
    let a = 0;

    for (let i = 0; i < dimensions; i++) {
        const dx = p0[i] - p1[i];

        a += dx * dx;
    }

    return Math.pow(a, half_alpha);
}