How do I get the y coordinate of a Bezier curve, given x coordinate?

1.4k Views Asked by At

I have a Bezier curve with following points
$x_0,y_0 = 0.03,0.03$(start point)
$x_1,y_1 = 0.335,0.6$
$x_2,y_2 = 0.667,0.9$
$x_3,y_3 = 1,1$(end point)
What is the equation for the curve in terms of $x$ and $y$ only? So that i can find the value of $y$ when I have $x$ where $(x,y)$ is a point on the curve.

1

There are 1 best solutions below

0
On BEST ANSWER

As the answers to the related questions point out, you can't really get $y$ as a function of $x$, in general.

But your particular case is (almost) a special one that's easy to handle. If you had $x_0 = 0$, $x_1 = \tfrac13$, $x_2 = \tfrac23$, $x_3 = 1$, then the equation would be: $$ y = (1-x)^3 y_0 + 3x(1-x)^2y_1 + 3x^2(1-x)y_2 + x^3y_3 $$ If you don't need high accuracy, then maybe you can use this equation, or adjust it a little to meet your needs.