Skip to content
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

expoOut glitch #6

Open
dirkpostma opened this issue May 16, 2017 · 2 comments
Open

expoOut glitch #6

dirkpostma opened this issue May 16, 2017 · 2 comments

Comments

@dirkpostma
Copy link

The expoOut function is meant to serve as an ease to gradually go from 0 to 1. I noted a glitch. When going from 0.0 to 1.0 in steps of 0.01, the last few values are as follows:

input: output:

0.96 0.9987114180558858
0.97 0.9987977105338428
0.98 0.9988782242626982
0.99 0.9989533462279919
1 1 
Diff from 0.98 to 0.99: 0.00007512196529368964
Diff from 0.99 to 1.00:  0.001046653772008077

As you can see, the diff 0.99 to 1.00 is substantually bigger than the diff from 0.98 to 0.99. In animations, this causes excactly what you try to prevent!

Looking at the code:

function expoOut(t) {
  return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t)
}

Returning 1.0 when t === 1.0 is WRONG in my opinion.

Agree?

@mattdesl
Copy link
Owner

Good catch — care to submit a PR with a working function? I am considering using a major verison bump for this, not sure...

@jrus
Copy link

jrus commented Sep 19, 2019

Is this some standard thing? Is there an external definition? The discontinuity in the “expo” functions is very weird, but many of these easing functions seem just made up, so of course you can do whatever you like with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants