@drozdik.m/lerp
Version:
Collection of lerp functions.
9 lines (8 loc) • 348 B
JavaScript
exports.__esModule = true;
exports.EaseInOutExpo = function (from, to, currentFrame, totalFrames) {
currentFrame /= totalFrames / 2;
if (currentFrame < 1)
return (to - from) / 2 * Math.pow(2, 10 * (currentFrame - 1)) + from;
currentFrame--;
return (to - from) / 2 * (-Math.pow(2, -10 * currentFrame) + 2) + from;
};