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