Bezier Curve for any given control points

681 Views Asked by At

So I'm working on my computer graphics project and i came up with this problem. I'm drawing Bezier curves on the screen, however, currently I'm limited to only drawing Bezier curves with 2,3,4 control points. How do i draw a Bezier curve for N control points? I need a formula for this curve. Splitting the whole curve into separate segments of Bezier curves is not going to work for me because i can break these control points and add them in the middle of each other. Any ideas? -Thanks!

1

There are 1 best solutions below

6
On

Using higher order Beziers is not recommended because the influence of the control points is less and less strong and control becomes difficult.

The formula is given by the Bernstein polynomials https://en.wikipedia.org/wiki/Bernstein_polynomial#Definition that you use as the coefficients of a linear combinations of the given points. You already know these polynomials for degrees $2, 3$ and $4$. They are in fact the terms of the binomial development of $(t+(1-t))^n$.

Depending on exactly what you need to achieve, other kinds of freeform curves might be a better choice.