@gamestdio/easing
Version:
Collection of easing equations for JavaScript / TypeScript
9 lines (8 loc) • 378 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function elasticInOut(t) {
return t < 0.5
? 0.5 * Math.sin(+13.0 * Math.PI / 2 * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0))
: 0.5 * Math.sin(-13.0 * Math.PI / 2 * ((2.0 * t - 1.0) + 1.0)) * Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;
}
exports.elasticInOut = elasticInOut;