-
Notifications
You must be signed in to change notification settings - Fork 136
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
if I want to get x by y? #38
Comments
There is not a single solution to this problem, bezier curve is not a bijection. That said, it only happens when one of the handle goes out of [0,1] on the y axis. So what you can do is simply switch x and y of the bezier parameter and I think you get the reverse function |
Best explanation of easing function |
I also need to resolve x from y.
I tried but no luck, do I also need to invert/adjust some other parameters? EDIT Looked at the the code more closely - just need to swap the position of first 2 arguments and last 2 arguments to // resolve y
const interpolate = bezier(0.4, 0, 0.6, 1)
// resolve x
const uninterpolate = bezier(0, 0.4, 1, 0.6)
const x = 0.25
const y = interpolate(x)
uninterpolate(y) === x // true |
I need this function。
The text was updated successfully, but these errors were encountered: