MA 323 Geometrc Modellng Course Notes: Day 13 Bezer Curves & Bernsten Polynomals Davd L. Fnn Over the past few days, we have looked at de Casteljau s algorthm for generatng a polynomal curve, and we have examned the subdvson method for approxmatng the curve generated by de Casteljau s algorthm. de Casteljau s algorthm s useful as a computatonal and theoretcal devce, but t s also frequently useful to look at a bass functon form for the curve gven by de Casteljau s algorthm. Specfcally, today, we examne curves descrbed by affne combnatons c(t) = α 0 (t) p 0 + α 1 (t) p 1 + + α n (t) p n, and examne the propertes of the coeffcents α (t). The bass functon form for de Casteljau s algorthm s also called the Bezer form or the Bernsten-Bezer form, after Perre Bezer an engneer workng for Renault who developed some of the methods for creatng such curves and workng wth a bass functon approach. It s also typcal to called the curves produced by de Casteljau s algorthm Bezer curves, after Bezer. You may wonder why both Bezer s name and de Casteljau s name are both attached to the same type of curve. The reason for attachng both names to the same type of curve s smple. In the early days of computer aded geometrc desgn, the prmary methods were developed as ndustral secrets. de Casteljau s algorthm was developed by P. de Casteljau workng for Ctroen and Bezer curves were developed by P. Bezer workng for Renault. Both of these methods were developed n the early 1960 s when CAD/CAM was frst begnnng to become an ndustral tool. The orgnal methods were carefully guarded ndustral secrets for well-over a decade. The orgnal papers n whch they were developed were never publshed except as techncal reports to the nteror research and development teams at Renault and Ctroen. When the methods later surfaced, Bezer s name was attached to the curves as hs methods were crculated frst, and later de Casteljau s methods were learned. Before examnng the bass functons n partcular, we frst look at how one can defne dervatves and perform the basc operatons of calculus on curves defned by affne combnatons. It s mportant to note that we can perform calculus on the curves, wthout workng through coordnates as n multvarate calculus. We then wll derve the explct form for the bass functons of a Bezer curve and then examne some of the propertes of the bass functons. The bass functons for an nth degree Bezer curve are nth degree polynomals known as Bernsten polynomals. 13.1 Calculus of Curves Defned by Affne Combnatons Through de Casteljau s algorthm, we have defned a polynomal curve as an affne combnaton (once we have expanded the coeffcents). Ths means, we have a curve c(t) defned
13-2 by c(t) = α 0 (t) p 0 + α 1 (t) p 1 + + α n (t) p n. for some functons α : [0, 1] R wth the property 1 = α 0 (t) + α 1 (t) + + α n (t), we examne n ths subsecton the dervatves of such a curve. Frst, recall the defnton of the dervatve of such a curve s defned as c c(t + h) c(t) (t) = lm. h 0 h Note that the dervatve mples that the dervatve s a vector, because the dervatve s defned as the dfference of two ponts then multpled by a length. The calculaton of the dervatve can be accomplshed by dfferentatng the coeffcents, as the ponts do not depend on t. In fact, n ths manner, one s never concerned wth the locaton of the ponts to determne propertes of the dervatves. Several propertes of the dervatves of curves defned by affne combnatons arse by mplct dfferentaton of the equaton 1 = α 0 (t) + α 1 (t) + + α n (t). In partcular, mplct dfferentaton mples that 0 = α 0(t) + α 1(t) + + α n(t). Note that as an affne combnaton ths means the dervatve expressed as c (t) = α 0(t) p 0 + α 1(t) p 1 + + α n(t) p n s a vector, as when the coeffcents sum to zero the quantty s a vector, opposed to when the coeffcents sum to one whch mples the quantty s a pont. All other dervatves are also vectors. 13.2 Bernsten Polynomals and Bezer Curves An mportant property of de Casteljau s algorthm (at least for computatonal purposes) s the explct form of the barycentrc coordnates for the control ponts. To determne the coeffcents, t s useful to follow the algorthm through completely for say four control ponts. Gven four control ponts p 0, p 1, p 2, p 3. The zeroth teraton of de Casteljau s algorthm produces the ponts p 0 0(t) = p 0, p 0 1(t) = p 1, p 0 2(t) = p 2, p 0 3(t) = p 3. The frst teraton of de Casteljau s algorthm then produces the ponts p 1 0 = (1 t) p 0 + t p 1, p 1 1(t) = (1 t) p 1 + t p 2, p 1 2(t) = (1 t) p 2 + t p 3.
13-3 The second teraton of de Casteljau s algorthm then produces the ponts Fnally, we obtan the curve p 2 0 = (1 t) 2 p 0 + 2t(1 t) p 1 + t 2 p 2, p 2 1 = (1 t) 2 p 1 + 2t(1 t) p 2 + t 2 p 3. c(t) = (1 t) 3 p 0 + 3t(1 t) 2 p 1 + 3t 2 (1 t) p 2 + t 3 p 3. Notce that the ntermedate ponts obtaned after each teraton have smlar coeffcents. In fact, the curves obtaned after the frst teraton are lnes, and the curves obtaned after the second teraton are parabolas (possbly degenerate). And lastly, the curve tself s a cubc curve. To derve the general form of the coeffcents, we use an nductve argument. We frst wrte an nth degree curve as c(t) = β n 0 (t) p 0 + β n 1 (t) p 1 + + β n n(t) p n where β n (t) are the bass functons for the nth degree curve. By the above computaton, we have the coeffcents for a cubc curve gven by β 3 3 (t) = t (1 t) 3. The conjecture s that the coeffcents of an nth degree curve (n+1 control ponts) are gven by β n n (t) = t (1 t) n, where n s the bnomal coeffcent, n n! =!(n )!. The crucal observaton n dervng the above general form s that the control ponts p 0, p 1,, p n 1 generate the (n 1)th degree p0 n 1 (t) and the control ponts p 1, p 2,, p n generate the (n 1)th degree curve p n 1 1 (t). We then use the defnton of p n 0 (t) = (1 t) p n 1 0 (t) + p n 1 1 (t) and some algebra to derve the above formula by nducton. We have already shown by drect computaton that the general formula s true for n = 0, 1, 2, 3. Expandng the sum (1 t) p n 1 0 (t) + t p n 1 1 (t), usng the formula for n 1 degree curves, we have β0 n (t) = (1 t) n, βn(t) n = t n, and ( ) β n n 1 n 1 (t) = + t (1 t) n n = t (1 t) n, + 1 by usng Pascal s trangle nterpretaton of bnomal coeffcents. n The coeffcents β n(t) = t (1 t) n are called the Bernsten polynomals. Notce for 0 t 1, we have 0 β n (t) 1, and β n 0 (t) + β n 1 (t) + + b n n(t) = 1.
13-4 Ths last fact s a drect consequence of notng that the Bernsten polynomals arse from expandng (1 t + t) n = 1 n. We note that the Bernsten polynomals posses the symmetry β n(t) = βn n (1 t), and as a result Bezer curves have a nce symmetry; f you reverse the order of the control ponts one obtans the same curve. Further, we note that β n(0) = 0 for = 1, 2,, n and βn 0 (0) = 1, and β n(1) = 0 for = 0, 1,, n 1 and βn n(1) = 1, whch mples that the curve passes through the ponts p 0 and p n. To see a graphcal depcton of the bass functons, and the propertes mentoned above, see the fgure below. Fgure 1: Bass functons β 4 (t) 13.3 Dervatves of Bezer Curves Gven the control ponts p 0, p 1,, p n, a Bezer curve wth these control ponts s gven by B(t) = β n 0 (t) p 0 + β n 1 (t) p 1 + + β n n(t) p n. Ths defnton of curves by barycentrc coordnates s useful as long as the degree remans fxed. For the remander of our dscusson, we vew the curve as defned by a set number of control and do not consder the addton or subtracton of a control pont to the control polylne. Formulas for dfferentatng a Bezer curve can be developed by examnng the dervatves of the Bernsten polynomals β n n (t) = t (1 t) n.
13-5 By drect computaton, we have d n ( dt (βn (t)) = t 1 (1 t) n (n ) t (1 t) n 1) n! =!(n )! t 1 (1 t) n n!!(n )! (n ) t (1 t) n (n 1)! = n ( 1)!(n )!, t 1 (1 t) n (n 1)! n!(n 1)! t (1 t) n 1 = n ( β n 1 1 (t) βn 1 (t) ). In the above, t s to be understood that β n(t) = 0 f < 0 and βn (t) = 0 f > n. Therefore, we have B (t) = nβ0 n 1 (t) p 0 + n(β0 n 1 (t) β1 n 1 (t)) p 1 + Rearrangng the terms, we have + n(βn 2 n 1 (t) βn 1 (t)) p n 1 + nβn 1 n 1 (t) p n. B (t) = nβ n 1 0 (p 1 p 0 ) + nβ n 1 1 (p 2 p 1 ) + + nβ n 1 n 1 (t) (p n p n 1 ). Notce that the dervatve s a Bezer curve wth n control ponts equal to the vectors n p = n(p +1 p ). Lkewse, we can defne hgher order dervatves. By applyng the same type of rule. The formulas for Bezer curves and dervatves of Bezer curves are greatly smplfed by ntroducng sum notaton. A Bezer curve s and the dervatve of a Bezer curve s B(t) = n β n (t) p =0 n 1 B (t) = n β n 1 (t) p =0 where p = p +1 p. The quanttes p s called the frst dfference of the control ponts. Hgher order dervatves are obtaned as generalzatons of these formulas, see exercses. 13.4 Exercses 1. Complete the nteractve exercses for Bezer curves and the Bernsten polynomals. 2. Gven the control ponts p 0 = [ 1, 0], p 1 = [1, 1], p 2 = [2, 1], p 3 = [1, 3]. (a) Wrte the coordnate functons of the Bezer curve B(t) wth these control ponts. (b) Dfferentate the coordnate functons and evaluate the dervatve when t = 0, t = 1/2 and t = 1. (c) Apply the formula B (t) = n β n 1 (t) p to compute the dervatve show ths yelds the same answer as n (b).
13-6 3. Derve a formula for the second dervatve of B(t). Express ths dervatve as a Bezer curve on the second dfferences 2 p = +1p p = p +2 2p +1 + p. 4. Gven the control ponts p 0 = [1, 1], p 1 = [2, 3], p 2 = [3, 0], p 3 = [1, 2]. (a) Wrte the coordnate functons of the Bezer curve through these control ponts. (b) Compute the second dervatve (by dfferentatng the expresson n (a) twce). (c) Compute the second dfferences, and wrte the second dervatve n terms of the second dfferences. (d) Verfy the two expressons of the second dervatve are equal. 5. Derve a formula for the thrd, fourth, ffth, et cetera dervatves of a Bezer curve n terms of hgher order dfferences. 6. Gven the fgure below, draw the frst, second and thrd dfferences as vectors. Where should each dfference be naturally based? [ 0 p = p 1 p 0 s naturally based at p 0. Why?] Fgure 2: Control Ponts