Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Say I have a cubic Bezier curve, with a starting point s, an ending point e and control points c1 and c2. Given t between 0-1, I want to find the equation of the subsection of the curve between 0 and t.

Is this possible without being too computationally expensive?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Yes, it's possible. The deCasteljau algorithm divides a Bezier curve into two. If you search, you'll find lots of references.

Let me change your notation: let the points of the curve be $A$, $B$, $C$, $D$. So, $A$ is the start point (where $t=0$), $D$ is the end-point (where $t=1$), and $B$ and $C$ are the control points adjacent to $A$ and $D$ respectively.

Suppose you are given a value $t$ at which you want to split the curve. The deCasteljau algorithm tells you to do the following calculations:

$$L = (1-t)A + tB \quad ; \quad M = (1-t)B + tC \quad ; \quad N = (1-t)C + tD $$ $$P = (1-t)L + tM \quad ; \quad Q = (1-t)M + tN $$ $$R = (1-t)P + tQ$$

Then the control points of the "left" portion of the Bezier curve (the piece from $0$ to $t$) are $A$, $L$, $P$, $R$. And, if you're interested, the control points of the "right" portion of the Bezier curve (the piece from $t$ to $1$) are $R$, $Q$, $N$, $D$.

This picture is not accurate, but it might be helpful:

decasteljau

share|improve this answer
    
Awesome, thanks. Exactly what I needed. –  berry120 Mar 4 '13 at 15:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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