Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between De Casteljau's algorithm and Bernstein polynomial?

Tags:

bezier

What does De Casteljau's algorithm say that Bernstein's polynomial doesn't say, or, vice versa?

Why do we need De Casteljau's algorithm if we know Bernstein polynomial?

Are they different or same?

like image 510
user366312 Avatar asked Aug 10 '15 06:08

user366312


People also ask

Why We Use Bernstein polynomial?

In addition to computer graphics, the Bernstein polynomials are also used in the approximation of functions, in statistics, in numerical analysis, in p-adic analysis, and in the solution of differential equations.

Is a Bezier curve a polynomial?

The coordinates of a Bezier curve are polynomial functions including the coefficients of Bernstein polynomial and the component of the control points.


2 Answers

Short answer: one's an analytical expression, the other a geometric algorithm. So you probably meant "What is the difference between drawing a Bezier curve using De Casteljau's algorithm vs just computing the Bernstein polynomial?".

Short answer to that: on a perfect computer, no difference. They are two seemingly different ways to reach an identical result. You use whichever is easier to use in the context you need them in.

Long answer: You can work out the maths and see that the Berstein polynomial can be expressed as a nested sequence of linear interpolations. That expression, and its geometric interpretation, is called De Casteljau's algorithm. On most hardware, the speed to evaluate either for a given t is the same. While both approaches come with rounding errors (because of IEEE floating point numbers), solving for the polynomial generates different errors in rounding than solving for the geometric expression. Neither is appreciably worse than the other, though.

So, to answer "Why do we need De Casteljau's algorithm if we know Bernstein polynomial?": there is no "we". There is only "you", on a case by case evaluation. Check which is most accurate and fastest, and then you use that for your specific use case.

Of course, sometimes it makes a LOT of difference. A CnC machine, for instance, cannot be expected to evaluate 3rd or higher order polynomials, but it can trivially execute a sequence of linear interpolations. So... again, context. You make the call, no one else.

And of course in terms of explaining Bezier curves there is a huge difference. The geometric interpretation is super simple to get, whereas the analytical interpretation requires having an understanding of high school calculus. But there's only so much insight you can gleam from the geometric example, whereas the analytic expression lets us discover a whole heap of properties. So again, context.

like image 125
Mike 'Pomax' Kamermans Avatar answered Nov 16 '22 04:11

Mike 'Pomax' Kamermans


The results of De Casteljau's algorithm are identical to using the Bernstein polynomials. But since the approaches are different, they can make some analysis of the results easier or harder.

As well, De Casteljau's algorithm is apparently slightly more numerically stable https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm

The geometric interpretation of the algorithm lends itself to learning about the concepts without having to introduce a lot of symbols.

like image 42
Arunas Avatar answered Nov 16 '22 02:11

Arunas