Sign in to follow this  

Bezier curves (Permutation problem?)

This topic is 3743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've recently tried to impliment bezier curves into an application. I'm ok with fixed length curves, but I want to write a general function that takes a variable number of points. Generating the coordinates on the curve when you know the number of points was straightforward enough, but I've ran into problems with unknown length curves. Applying the general function has been the problem. the value of the point P is multiplied by some value that depends on the number of points, but I'm not sure what the relation between the length of the curve and this value is. eg on the link here: http://en.wikipedia.org/wiki/B%C3%A9zier_curve for N = 5 the points P0 -> P5 are multiplied by 1,5,10,10,5,1 respectivley. How is this calculated? I think someone mentioned permutations to me, but I'm not sure how to apply this.

Share this post


Link to post
Share on other sites
Quote:
Original post by Winegums
Hi, I've recently tried to impliment bezier curves into an application. I'm ok with fixed length curves, but I want to write a general function that takes a variable number of points. Generating the coordinates on the curve when you know the number of points was straightforward enough, but I've ran into problems with unknown length curves.

Applying the general function has been the problem. the value of the point P is multiplied by some value that depends on the number of points, but I'm not sure what the relation between the length of the curve and this value is.

eg on the link here:

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

for N = 5 the points P0 -> P5 are multiplied by 1,5,10,10,5,1 respectivley. How is this calculated? I think someone mentioned permutations to me, but I'm not sure how to apply this.
IIRC, the pattern of coefficients is the same as that of Pascal's triangle.

If you run into any other problems, I have some code lying around for n-degree Bezier curves that might be a useful reference (and which I'd be happy to post).

Share this post


Link to post
Share on other sites
It's a row of pascal's triangle. I believe it would be N choose whichever number it is. N!/(r!(N-r)!) 5!/0!5! = 1, 5!/(1!4!) = 5, 5!/(2!3!) = 10 etc.

edit: beaten again!

Share this post


Link to post
Share on other sites

This topic is 3743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this