ai / ai/easings.net

easeOutBack math function for 0 is incorrect

未关闭
#151 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
CSS
星标
8.7k
派生
696
PR 合并指标
30 天内没有已合并 PR

描述

Using the Math function for easeOutBack: https://easings.net/#easeOutBack

```ts
function easeOutBack(x: number): number {
const c1 = 1.70158;
const c3 = c1 + 1;

return 1 + c3 * pow(x - 1, 3) + c1 * pow(x - 1, 2);
}

console.log(easeOutBack(0))
```

results in `2.220446049250313e-16` whereas it should be `0`

If the calculation is correct then a simple conditional to return `0` when `x === 0` would be necessary.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。