7 lines
279 B
JavaScript
7 lines
279 B
JavaScript
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
|
|
}
|
|
|
|
module.exports = elasticInOut |