0
$\begingroup$

>> Visual picture of my problem <<

In the attached picture I have this bezier-curve (or easing curve), represented by 4 coordinates:

P0 (0, 0)
P1 (0.7, 0)
P2 (0.3, 1)
P3 (1, 1)

Given a specific time that can range between zero and one, I need to find the corresponding value that intersect the bezier-curve.

In this example, when time is equal to 0.6, I was able to find out that the corresponding value is approximately 0.7702, since I was able to measure it on the software I'm using (Illustrator). What I need though is a mathematical formula to calculate the corresponding value given any time.

I have no idea how -__-

$\endgroup$
0
$\begingroup$

The $x$ equation is

$$x=t^3\cdot0+3t^2(1-t)\cdot0.7+3t(1-t)^2\cdot0.3+(1-t)^3\cdot1.$$

For a given $x$, you need to solve this cubic equation for $t$. You can do it for example using the analytic formulas.

http://www.wolframalpha.com/input/?i=solve+x%3Dt%5E3+0%2B3t%5E2(1-t)+0.7%2B3t(1-t)%5E2+0.3%2B(1-t)%5E3+1+for+t

When you have $t$, plug it in the $y$ equation.

Not so simple.

$\endgroup$
  • $\begingroup$ Help me understand. I am assuming that "x" is the final value that I am looking for, right? If I am doing this right, when I plug in t = 0.6 it's pretty easy to do the calculation, but the equation returns x = 0.4528, instead of x = 0.7702 (approximately). Am I doing something wrong? $\endgroup$ – Francesco Aug 11 '18 at 16:24
  • $\begingroup$ @Francesco: no, you don't seem to have understood my post. From $x$ deduce $t$ and from $t$, $y$. I said not so simple. $\endgroup$ – Yves Daoust Aug 11 '18 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.