Comments (3)
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
from bezier-easing.
I also need to resolve x from y.
So what you can do is simply switch x and y of the bezier parameter and I think you get the reverse function
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 bezier
function and then call the returned function with the y
that you need the x
for.
// 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
from bezier-easing.
Best explanation of easing function
https://www.selectionjs.com/animation
from bezier-easing.
Related Issues (20)
- Example link in readme can't be found HOT 1
- Version 1.0 breaks with angular/bower HOT 2
- `var global = this;` causes break while working with es6 `import` HOT 1
- New version, problem with GSAP HOT 4
- index.js:54 Uncaught ReferenceError: module is not defined HOT 2
- Looking to make complex curves HOT 11
- Curve not working on Raspberry Pi in QML HOT 3
- BezierEasing() should start with lower case letter HOT 1
- Breaking compilation whitespace index.js:140 HOT 5
- Add typescript definitions HOT 1
- Is this intentional behavior? HOT 5
- Typings file not found in latest npm install HOT 4
- TimeFunction link in README.md is broken HOT 1
- bezier library HOT 1
- Very slow on babel+rollup ES6/ES7 compilation HOT 8
- jQuery.easing or bezier-easing, which is faster ? HOT 2
- 'bezier-easing'. CommonJS or AMD dependencies can cause optimization bailouts. HOT 1
- How to use with svg path's bezier curve, degined by 6 points? HOT 1
- Links in README are broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bezier-easing.