-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return values of 0 and 1 are not always as expected #27
Comments
I think it's a bug. For back it's just a matter of reordering the operations to avoid bad rounding. backIn(t) is computed as For elastic, and exp the formula is not really expected to give 0 in 0 or 1 in 1 as it uses Math.pow(2,-10) instead of 0. A solution for these would be to introduce Finally for sinIn there doesn't seem to be a solution other than an equality test (t === 1 ? 1 : Math.cos(…)) |
partly addresses #27 (a fix for elastic and exp requires a change to *all* the corresponding tests)
I've pushed a rather simple solution for back and for sin, and a second commit solves it for elastic and exp (but breaks all the tests). |
partly addresses #27 (a fix for elastic and exp requires a change to *all* the corresponding tests)
I ran into an issue animating with easeExpInOut where the end result was not exactly 1. The readme states "A good easing type should return 0 if t = 0 and 1 if t = 1", but a few of these do not.
https://observablehq.com/@danmarshall/d3-easing-at-0-1
Not sure if this is a bug or not, but hopefully this helps anyone else with this issue.
The text was updated successfully, but these errors were encountered: