UNPKG

@drozdik.m/lerp

Version:
9 lines (8 loc) 341 B
exports.__esModule = true; exports.EaseInOutQuad = function (from, to, currentFrame, totalFrames) { currentFrame /= totalFrames / 2; if (currentFrame < 1) return (to - from) / 2 * currentFrame * currentFrame + from; currentFrame--; return -(to - from) / 2 * (currentFrame * (currentFrame - 2) - 1) + from; };