/**
 * 2-nd (quadratic) degree bezier curve
 * @param {number} t
 * @param {number} p0
 * @param {number} p1
 * @param {number} p2
 * @return {number}
 */
export function spline2_bezier(t, p0, p1, p2) {
    const inv_t = 1 - t;

    return inv_t * inv_t * p0 + 2 * inv_t * t * p1 + t * t * p2;
}