/**
 * Easing function for smooth acceleration and deceleration with a "back" effect, commonly used in animations.
 * @param {number} t - The normalized time (from 0 to 1).
 * @param {number} [s=1.7] - Overshoot amplitude; default is 1.7 for a standard "back" effect.
 * @returns {number} The eased value for the given time.
 */
export function easeInOutBack(t: number, s: number = 1.7): number
{
    return t < 0.5
        ? (Math.pow(2 * t, 2) * (((s + 1) * 2 * t) - s)) / 2
        : ((Math.pow((2 * t) - 2, 2) * (((s + 1) * ((t * 2) - 2)) + s)) + 2) / 2;
}
