Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Is there an explicit form for cubic Bézier curves?

I want to calculate Y for any given X of a bezier to help me chart a graph.

X represents time and Y represents distance from an object.

I got this formula for cubic beziers:

$$X(t) = (1-t)^3 X_0 + 3(1-t)^2 t X_1 + 3(1-t) t^2 X_2 + t^3 X_3$$

$$Y(t) = (1-t)^3 Y_0 + 3(1-t)^2 t Y_1 + 3(1-t) t^2 Y_2 + t^3 Y_3$$

I need to know what $t$ is for $X$ to I can work out what $Y$ would be for $t$... right?

So I need to rearrange this formula with $t$ on the left, I think:

$$X(t) = (1-t)^3 X_0 + 3(1-t)^2 t X_1 + 3(1-t) t^2 X_2 + t^3 X_3$$

Ummmm... is this right?

share|cite|improve this question

marked as duplicate by J. M., William, rschwieb, sdcvvc, Emily Sep 27 '12 at 18:42

This question was marked as an exact duplicate of an existing question.

I think that normally you'd start with t, find x and find y. I am not sure why you are starting with x? – NoChance Sep 6 '12 at 1:40

One way to graph $Y$ in terms of $X$ would be to choose { X0, X1, X2, X3 } so that $X( t ) = t$, so you can choose the control points { 0, 1/3, 2/3, 1 }.

share|cite|improve this answer
I'm sorry that doesn't make sense to me. Can you possibly link me to a page with more detailed explanation? – Beakie Sep 6 '12 at 3:26
I found this...… what technique do they use? (see xAtY) – Beakie Sep 6 '12 at 3:44
Sorry, I misunderstood your question then. The function xAtY first converts a quadratic bezier to power basis form. The resulting quadratic equation is solved to find the t corresponding to the given Y. The bezier curve is then evaluated at the two roots to get the X. – SKP Sep 6 '12 at 4:07

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