Derivatives of rational B ezier curves
M. S. Floater Centre for Industrial Research Forskningsveien 1 Blindern 0314 Oslo 3 Norway February 1991, Revised November 1991 Abstract. Two equations are presented which express the derivative of a rational B ezier curve in terms of its control points and weights. These equations are natural generalisations of the non-rational case and various properties are found from them. Bounds on the magnitude of the derivative and the direction of the derivative (the hodograph) are obtained. Expressions for the second derivative, curvature, and torsion of the curve are also calculated. 1. Introduction Rational B ezier and B-spline curves and surfaces are well established as a convenient way to represent Computer Aided Design geometry. Good introductions can be found in Faux & Pratt (1979) and Farin (1988). There are also articles covering the recursive algorithm for evaluating rational B ezier curves, Farin (1983), and recursive algorithms for rational B ezier surfaces, Piegl (1986). Various geometric constructions using rational B-splines are given by Piegl & Tiller (1987). Many properties of non-rational curves have been naturally extended to equivalent properties of rational curves such as evaluation, subdivision, the convex hull property and degree elevation. Assuming the rational curve lies in I R3 , a typical method is as follows. (i) Map the rational curve into I R4 using homogeneous coordinates. The resulting curve is then non-rational. (ii) Observe that the desired property holds for the non-rational curve in I R4 . (iii) Show that when we map the curve back to I R3 the property continues to be true. Properties which do not extend to rational curves in this way are those which involve derivatives. This is due to the fact that the derivative of the I R3 rational curve is very dierent to the projection of the non-rational I R4 derivative. Indeed, this deciency could be seen as a drawback of using rational curves and surfaces instead of non-rational ones in CAD. The evaluation of derivatives is less stable and more time consuming. In this paper we attempt to improve the situation. There are two known formulas for the derivative of a (non-rational) B ezier curve P (t) dened by (13). One of them expresses P (t) as a function (14) of the last two intermediate points in the de Casteljau algorithm (P1,n1 (t) P0,n1 (t)). The other expresses P (t) as a function (15) of the control polygon segments (Pi+1 Pi ). In this paper we generalise 1
both these formulas to the rational case (11) and (12). Equations (11) and (12) provide numerically stable ways of computing P (t). From them we obtain upper bounds on P (t) and the hodograph property. Formulas for the curvature and torsion of a rational curve in terms of the intermediate de Casteljau points are found from (11). To keep things as simple as possible we only treat B ezier curves here though some of the results are being extended to NURBS in a forthcoming paper, Floater (1991). We start by making some basic denitions. Denition. Given the control points P0 , P1 , . . . , Pn I R3 and the associated nonnegative weights w0 , w1 , . . . , wn we can dene, for 0 t 1, the rational B ezier curve P of degree n as P (t ) =
n i=0 Bi,n (t)wi Pi n i=0 Bi,n (t)wi
(1)
where B0,n , B1,n , . . . , Bn,n are the Bernstein polynomials, Bi,n (t) = n i t (1 t)ni . i (2)
Farin (1983) gave a recursive algorithm for calculating P (t), analogous to the de Casteljau algorithm. If we dene the intermediate weights wi,k (t) as
k
wi,k (t) =
j =0
Bj,k (t)wi+j ,
(3)
we can compute them using the de Casteljau algorithm, wi,k = (1 t)wi,k1 + twi+1,k1 . Now dene the intermediate points Pi,k (t) as Pi,k (t) =
k j =0 Bj,k (t)wi+j Pi+j k j =0 Bj,k (t)wi+j
(4)
(5)
It follows that Pi,0 (t) = Pi and P0,n (t) = P (t). Farin showed that wi,k Pi,k = (1 t)wi,k1 Pi,k1 + twi+1,k1 Pi+1,k1 (6)
and hence that (4) and (6) together represent a recursive algorithm for computing P (t), see gure 1. Now consider the problem of nding the derivative P (t) of the curve P (t). Assuming P (t) is already known, an obvious solution is to rewrite (1) as P (t ) = 2 a(t ) . b( t )
P P
1,0
= P
2,0
= P
1,1
1,2
2,1
0,2
0,3
= P(t)
0,1
3,0
= P
0,0
= P
Figure 1. The recursive evaluation scheme. It depends on the points and their weights.
Now since bP = a it follows that b P + bP = a and hence P (t ) = a (t ) b (t )P (t ) . b( t ) (7)
Now the functions a(t) and b(t) are dierentiated by using the identity Bi,n (t) = n(Bi1,n1 (t) Bi,n1 (t)), see Farin (1988). We then nd
n n1
(8)
a (t ) =
i=0
Bi,n (t)wi Pi = n
i=0
Bi,n1 (t)(wi+1 Pi+1 wi Pi )
(9)
and
n1
b (t ) = n
i=0
Bi,n1 (t)(wi+1 wi ).
(10)
This method enables us to determine P (t) but it is dicult to gain any geometrical insight into its behaviour. In this paper, we derive the formulas P (t ) = n and
n1
w0,n1 (t)w1,n1 (t) (P1,n1 (t) P0,n1 (t)) 2 (t ) w0 ,n
(11)
P (t ) =
i=0
i (t)(Pi+1 Pi ) 3
(12)
where, for i = 0, . . . , n 1, i (t ) = n
2 (t ) w0 ,n i n
(Bj,n1 (t)Bk1,n1 (t) Bj 1,n1 (t)Bk,n1 (t))wj wk (12a)
j =0 k=i+1 i n
1 2 (t ) (1 t)tw0 ,n
(k j )Bj,n (t)Bk,n (t)wj wk .
j =0 k=i+1
(12b)
These two expressions generalise those for the non-rational curve. By setting w i = 1 for i = 0, . . . , n, P (t) becomes the non-rational B ezier curve
n
P (t ) =
i=0
Bi,n (t)Pi .
(13)
In this case wi,k (t) = 1 for all t, i, k and so equation (11) reduces to the well known equation P (t) = n(P1,n1 (t) P0,n1 (t)), (14) see e.g. Farin (1988). We can show that equation (12) also simplies when w i = 1, for all i. If this were the case, we could use the fact that
i i
(Bj,n1 Bk1,n1 Bj 1,n1 Bk,n1 ) = 0
j =0 k=0
to show that i =n
(Bj,n1 Bk1,n1 Bj 1,n1 Bk,n1 )
j =0 k=i+1 i n
=n
j =0 k=0 i
(Bj,n1 Bk1,n1 Bj 1,n1 Bk,n1 )
=n
j =0
(Bj,n1 Bj 1,n1 )
=nBi,n1 and hence P (t ) = n
i=0 n1
Bi,n1 (t)(Pi+1 Pi )
(15)
as expected when P is non-rational. After giving the proofs of (11) and (12) in Section 2 we derive various useful properties of P (t) in Section 3. First of all, from equation (11) it immediately follows that the curve P is tangential to P1,n1 (t) P0,n1 (t) at t. It is also simple to deduce that at the two wn1 1 ends of the curve we have P (0) = w w0 (P1 P0 ) and P (1) = wn (Pn Pn1 ). Moreover, 4
P
2
P (t) P -P P(t) P
1 1 0
P -P
2
1
/
P (t)
P -P
3
Figure 2. Every tangent to the curve lies between the control segments.
we show later that equation (11) also leads to the following upper bound on the magnitude of the derivative in terms of the weights and control points, W P (t ) n max Pi Pj (16) w i,j =0,...,n where W = maxi {wi } and w = mini {wi }. An immediate consequence of equation (12) combined with (12b) is that P has the hodograph property. That rational B ezier curves have this property was shown by Sederberg & Wang (1988) via a dierent approach. A curve is said to have the hodograph property if, at all points on the curve, the tangent (in the direction of increasing t) lies between the directions of the control polygon segments Pi+1 Pi , see gure 2. The existence of the hodograph has many implications. It means, for example, that one can often determine whether the curve is open or closed, whether two curves can intersect tangentially, and to compute a good bounding box for an oset curve. Further details and some applications of the hodograph property are given in Sederberg & Meyers (1988). We further show in Section 3 that we can nd another upper bound on P (t) , namely W2 max Pi+1 Pi . (17) w2 i=0,...,n1 There are situations where the bound (17) is sharper than (16) and others where the opposite is true. If all the control points P0 , . . . , Pn are evenly spaced along a straight line and all the weights are set to 1 then (17) is the better bound. On the other hand, when n = 2 and P0 , P1 , and P2 form an equilateral triangle and the weights are not all equal, then (16) is sharper. In applications one could calculate both bounds and use the minimum of the two. Expressions for higher derivatives rapidly become complicated. Nevertheless, by demonstrating a simple recursive formula for the dierence Pi+1,k Pi,k namely, wi,k1 wi+2,k1 Pi+1,k Pi,k = (1 t) (Pi+1,k1 Pi,k1 ) + t (Pi+2,k1 Pi+1,k1 ) (18) wi,k wi+1,k we are able to show that the second derivative is w2,n2 2 P =n 3 (2nw0 ,n1 (n 1)w0,n2 w0,n 2w0,n1 w0,n )(P2,n2 P1,n2 ) w0,n (19) w0,n2 2 ( n 1) w w 2 w w )( P P ) . n 3 (2nw1 2,n1 0,n 1,n1 0,n 1,n2 0,n2 ,n1 w0,n P (t ) n 5
Despite the complexity of higher derivatives, relatively neat expressions are obtained for the curvature and torsion of P in Section 4. We prove that the curvature is given by (P1,n2 P0,n2 ) (P2,n2 P1,n2 ) (n 1) R1 (20) = n (P1,n1 P0,n1 ) 3 and the torsion is given by (n 2) (P1,n3 P0,n3 ) (P2,n3 P1,n3 ).(P3,n3 P2,n3 ) = R2 (21) n (P1,n2 P0,n2 ) (P2,n2 P1,n2 ) 2 where 2 3 w0,n3 w1,n3 w2,n3 w3,n3 w0 w0,n2 w1,n2 w2,n2 w0 ,n ,n . and R2 = R1 = 2 3 2 3 2 w0,n1 w1,n1 w0,n2 w1,n2 w2,n2 These formulas oer a direct approach to calculating the curvature and torsion. A less direct method is to subdivide the curve at the given parameter value. One can then apply the known formulas for curvature and torsion at the end of a curve as described in Farin (1988). 2. The derivative of a B ezier curve Throughout this article we will only ever consider one parameter value t at a time so there is no ambiguity in dropping the t. Furthermore we will dene B i,k (t) = 0 for all t whenever i < 0 or i > n. First of all we derive equation (11). Proposition 1. Given the B ezier curve of degree n dened by equations (4) and (6), the derivative of P at t is w0,n1 w1,n1 P =n (P1,n1 P0,n1 ). 2 w0 ,n Proof. Recalling equations (3) and (5) for wi,k and Pi,k , we nd that from (9), a = n(w1,n1 P1,n1 w0,n1 P0,n1 ) and, from (10), b = n(w1,n1 w0,n1 ). The substitution of these identities into (7) implies w0,n P = n(w1,n1 P1,n1 w0,n1 P0,n1 ) n(w1,n1 w0,n1 )P0,n . Therefore, applying (4) and (6), we have
2 w0 ,n P =n(w1,n1 w0,n P1,n1 w0,n1 w0,n P0,n1 )
n(w1,n1 w0,n1 )((1 t)w0,n1 P0,n1 + tw1,n1 P1,n1 ) =n{w1,n1 w0,n P1,n1 w0,n1 w0,n P0,n1 (1 t)w0,n1 w1,n1 P0,n1
2 2 + (1 t)w0 ,n1 P0,n1 tw1,n1 P1,n1 + tw0,n1 w1,n1 P1,n1 }
=n{w1,n1 (w0,n tw1,n1 + tw0,n1 )P1,n1 w0,n1 (w0,n + (1 t)w1,n1 (1 t)w0,n1 )P0,n1 } =n{w1,n1 w0,n1 P1,n1 w0,n1 w1,n1 P0,n1 } =nw0,n1 w1,n1 (P1,n1 P0,n1 ) as claimed. 6
Observe that we can nd a similar expression for Pi,k (t) given any k {1, . . . , n} and i {0, . . . , n k } by noticing that Pi,k (t) is itself a B ezier curve with control points Pi , . . . , Pi+k and weights wi , . . . , wi+k . Equation (11) then becomes Pi,k = k wi,k1 wi+1,k1 (Pi+1,k1 Pi,k1 ). 2 wi,k (22)
because P (t) = P0,n (t) and the computation is valid for every B ezier curve. In order to prove equation (12) it is necessary to employ the following lemma concerning the basis functions. Lemma 2. For any i, j {0, . . . , n}, t [0, 1], Bi,n Bj,n Bi,n Bj,n =n(Bi1,n1 Bj,n1 Bi,n1 Bj 1,n1 ) Bi,n Bj,n Bi,n Bj,n Bi,n Bj,n =(i j ) (1 t)t (23) (24)
Proof. To prove the rst identity, recall the formula for Bi,n (t), equation (8), and the recursive formula for Bi,n (t), Bi,n (t) = (1 t)Bi,n1 (t) + tBi1,n1 (t). By substituting these into the left hand side of (23) and simplifying the subsequent expression we prove (23). Now expand the right hand side of (23) using denition (2). After collecting together common terms, (24) follows from straightforward algebra. Note the right hand side of (24) is a removable singularity at t = 0 and t = 1 since Bi,n (t)Bj,n (t) is always a multiple of (1 t)t unless i = j = 0 or i = j = n. The identities (23) and (24) are used to prove the following. Proposition 3. Given the B ezier curve of degree n dened by equation (1), the derivative of P at t is
n1
P (t ) =
i=0
i (t)(Pi+1 Pi )
where i (t ) = n
2 (t ) w0 ,n i n
(Bj,n1 (t)Bk1,n1 (t) Bj 1,n1 (t)Bk,n1 (t))wj wk
j =0 k=i+1 i n
1 = 2 (t ) (1 t)tw0 ,n Proof. Rewrite (1) as
n
(k j )Bj,n (t)Bk,n (t)wj wk .
j =0 k=i+1
P (t ) =
i=0
i (t )w i P i ,
i (t ) = 7
n k=0
Bi,n (t) Bi,n (t) . = w0,n (t) Bk,n (t)wk
Then 1 i = 2 w0,n = 1 2 w0 ,n
n n
Bk,n wk Bi,n
k=0 n k=0
Bk,n wk Bi,n
(Bi,n Bk,n Bi,n Bk,n )wk .
k=0
Now, at any t, P is in the form
n
P =
i=0
a i Pi
where ai = i (t)wi and we wish to rewrite it in the form
n1
P =
i=0
i (Pi+1 Pi ).
(25)
If we set i =
i j =0 n1
aj we nd
n n1
i (Pi+1 Pi ) =
i=0 i=1
i1 Pi
i=0 n1
i Pi (i1 i )Pi 0 P0
=n1 Pn +
i=1
= =
n1
j =0 n
a j Pn + a j Pn +
n1
a i Pi + a 0 P0
i=1 n
a i Pi .
i=0
j =0
Thus we can write P in the form of (25) if the condition
n
ai = 0
i=0
is satised. Well, the condition is indeed satised since, by symmetry,
n
i (t )w i =
i=0
1
2 (t ) w0 ,n
(Bi,n (t)Bk,n (t) Bi,n (t)Bk,n (t))wi wk = 0.
i=0 k=0
Therefore we can express P in the form of (25) where 1 i (t ) = 2 w0,n (t) = 1
2 (t ) w0 ,n i n
(Bj,n (t)Bk,n (t) Bj,n (t)Bk,n (t))wj wk
j =0 k=0 i n
(Bk,n (t)Bj,n (t) Bk,n (t)Bj,n (t))wj wk
j =0 k=0 i n
1
2 (t ) w0 ,n
(Bk,n (t)Bj,n (t) Bk,n (t)Bj,n (t))wj wk .
j =0 k=i+1
The last step comes from the fact that, again by symmetry,
i i
(Bk,n (t)Bj,n (t) Bk,n (t)Bj,n (t))wj wk = 0.
j =0 k=0
Using Lemma 2, we can write i in the two alternative forms n
2 (t ) w0 ,n i n
i (t ) =
(Bj,n1 (t)Bk1,n1 (t) Bj 1,n1 (t)Bk,n1 (t))wj wk
j =0 k=i+1
and 1 i (t ) = 2 (t ) (1 t)tw0 ,n which completes the proof.
i n
(k j )Bj,n (t)Bk,n (t)wj wk
j =0 k=i+1
3. Upper bounds and the hodograph In some applications of rational B ezier curves and surfaces it is important to have a measure of the size of the derivatives. For example, in a paper by Filip, Magedson & Markot (1986) an ecient subdivision algorithm was presented for the intersection of surfaces. Testing for atness can be eliminated and determining bounding boxes can be speeded up provided upper bounds on the magnitudes of the rst and second derivatives of the surface can be calculated in advance. We are thus motivated to nd a bound for P (t). By applying equation (11) we can obtain information about the magnitude of the derivative of P (t). Previously an upper bound has only been obtained for the derivative of a non-rational B ezier curve where P (t ) n
i=0,...,n1
max
Pi+1 Pi
as described in Filip, Magedson & Markot (1986). In the rational case it follows from (11) that w0,n1 w1,n1 P1,n1 P0,n1 . P (t ) n 2 w0 ,n Now since P0,n1 and P1,n1 are convex combinations of P0 , . . . , Pn , we can write
n n
P0,n1 =
i=0
a i Pi
n j =0 bj
and
P1,n1 =
j =0
bj P j
where
n i=0
ai = 1, ai 0 and
= 1, bj 0. It follows that
n n
P1,n1 P0,n1 =
j =0 n
bj P j
i=0 n
a i Pi
n n
=
i=0 n
ai
j =0 n
bj P j
i=0
a i Pi
j =0
bj
=
i=0 j =0
a i b j (P i P j ).
By considering each of the two possibilities w0,n1 w1,n1 and w0,n1 w1,n1 it follows that either w0,n w0,n1 or w0,n w1,n1 and thus w0,n1 w1,n1 max 2 w0 ,n w0,n1 w1,n1 , w0,n w0,n W w
for all t, where W = maxi {wi } and w = mini {wi } (it is clear that w wi,k (t) W from the denition of wi,k ). Therefore P (t ) n W w max Pi Pj .
i,j =0,...,n
10
A dierent upper bound for P (t) can be computed from equation (12). Following a similar argument to that on page 4 and since wi,k 0, Bi,k 0, and w wi,k W for all i, k , and t, we can deduce that W2 1 P (t ) M 2 w (1 t)t W =nM 2 w =nM =nM W w2
2 n1 i n1 i n
(k j )Bj,n (t)Bk,n (t)
i=0 j =0 k=i+1 n
(Bj,n1 (t)Bk1,n1 (t) Bj 1,n1 (t)Bk,n1 (t))
i=0 j =0 k=0
2 n1
Bi,n1 (t)
i=0
W2 w2
where M = maxi Pi+1 Pi . Finally, equation (12b) not only yields a bound on the magnitude of P but on its direction as well. Since k j > 0 for all j i, k i + 1 it is clear that i 0. A consequence of this is that P has the hodograph property dened by Sederberg & Meyers (1988) i.e. P can be expressed in the form
n
P (t ) =
i=0
i (t)(Pi+1 Pi )
where i (t) 0 for all i and t. Thus we have demonstrated an alternative proof of the hodograph property for rational B ezier curves.
11
4. Higher derivatives, curvature and torsion Having found equation (11) for the rst derivative of P (t) it is natural to search for similar expressions for higher derivatives. These derivatives quickly become unwieldy and we were not able to obtain a general expression for the nth derivative. However we will demonstrate equation (19) for the second derivative. First we prove a lemma. Lemma 4. Given the B ezier curve of degree n dened by equations (4) and (6) and given any k {1, . . . , n 1} and i {0, . . . , n k }, the following expression holds: Pi+1,k Pi,k = (1 t) wi+2,k1 wi,k1 (Pi+1,k1 Pi,k1 ) + t (Pi+2,k1 Pi+1,k1 ). wi,k wi+1,k
Proof. To ease notation we will only prove it for i = 0; the algebra is identical for any i {0, . . . , n k }. From denition (6) we nd P1,k P0,k = (1 t)w1,k1 P1,k1 + tw2,k1 P2,k1 (1 t)w0,k1 P0,k1 + tw1,k1 P1,k1 . w1,k w0,k Therefore w0,k w1,k (P1,k P0,k ) =w0,k ((1 t)w1,k1 P1,k1 + tw2,k1 P2,k1 ) w1,k ((1 t)w0,k1 P0,k1 + tw1,k1 P1,k1 ) =tw0,k w2,k1 P2,k1 (1 t)w1,k w0,k1 P0,k1 + ((1 t)w0,k w1,k1 tw1,k w1,k1 )P1,k1 . But the coecient of P1,k1 can be rewritten as (1 t)w0,k w1,k1 tw1,k w1,k1 =w0,k (w1,k tw2,k1 ) w1,k (w0,k (1 t)w0,k1 ) = tw0,k w2,k1 + (1 t)w1,k w0,k1 . Hence w0,k w1,k (P1,k P0,k ) = tw0,k w2,k1 P2,k1 (1 t)w1,k w0,k1 P0,k1 + (tw0,k w2,k1 + (1 t)w1,k w0,k1 )P1,k1 =(1 t)w1,k w0,k1 (P1,k1 P0,k1 ) + tw0,k w2,k1 (P2,k1 P1,k1 ) as required. Note that Lemma 4 provides yet another way of computing P (t). One can begin by computing Pi+1 Pi for each i. One can then recursively compute Pi+1,k (t) Pi,k (t) until P1,n1 (t) P0,n1 (t) has been found. This can then be substituted into (11). 12
Proposition 5. Given the B ezier curve of degree n 2 dened by equations (4) and (6), the second derivative of P (t) is w2,n2 2 P =n 3 (2nw0 ,n1 (n 1)w0,n2 w0,n 2w0,n1 w0,n )(P2,n2 P1,n2 ) w0,n w0,n2 2 n 3 (2nw1 ,n1 (n 1)w2,n2 w0,n 2w1,n1 w0,n )(P1,n2 P0,n2 ). w0,n Proof. Rewrite (11) as
2 w0 ,n P = nw0,n1 w1,n1 (P1,n1 P0,n1 ).
Then dierentiating and applying Lemma 4 and (22) gives
2 2w0,n w0,n P + w0 ,n P
=n(w0,n1 w1,n1 + w0,n1 w1,n1 )(P1,n1 P0,n1 ) + nw0,n1 w1,n1 (P1,n1 P0,n1 ) =n(n 1)((w1,n2 w0,n2 )w1,n1 + w0,n1 (w2,n2 w1,n2 )) w0,n2 w2,n2 {(1 t) (P1,n2 P0,n2 ) + t (P2,n2 P1,n2 )} w0,n1 w1,n1 + n(n 1)w0,n1 w1,n1 w0,n2 w1,n2 w1,n2 w2,n2 (P2,n2 P1,n2 ) (P1,n2 P0,n2 )} { 2 2 w1,n1 w0 ,n1 =n(n 1)a(P1,n2 P0,n2 ) + n(n 1)b(P2,n2 P1,n2 ) (26) where a and b have to be calculated. Well w0,n1 a =(1 t)w0,n2 (w1,n2 w0,n2 )w1,n1 + (1 t)w0,n2 w0,n1 (w2,n2 w1,n2 ) w0,n2 w1,n2 w1,n1 = w0,n2 w0,n1 w1,n1 + (1 t)w0,n2 w0,n1 (w2,n2 w1,n2 ) =w0,n2 w0,n1 {w1,n1 + (1 t)(w2,n2 w1,n2 )} =w0,n2 w0,n1 (w2,n2 2w1,n1 ) so that a = w0,n2 (w2,n2 2w1,n1 ) and similarly b = w2,n2 (2w0,n1 w0,n2 ). Now by Lemma 4, 2w0,n w0,n P =2n2 (w1,n1 w0,n1 ) =2 w0,n1 w1,n1 (P1,n1 P0,n1 ) w0,n
n2 (w1,n1 w0,n1 ){(1 t)w0,n2 w1,n1 (P1,n2 P0,n2 ) w0,n + tw2,n2 w0,n1 (P2,n2 P1,n2 )} n2 {w0,n2 w1,n1 (w1,n1 w0,n )(P1,n2 P0,n2 ) w0,n + w2,n2 w0,n1 (w0,n w0,n1 )(P2,n2 P1,n2 )}. 13
=2
Therefore, from (26),
3 w0 ,n P = A(P2,n2 P1,n2 ) B (P1,n2 P0,n2 )
where A =n(n 1)w2,n2 (2w0,n1 w0,n2 )w0,n 2n2 w2,n2 w0,n1 (w0,n w0,n1 )
2 =nw2,n2 (2nw0 ,n1 (n 1)w0,n2 w0,n 2w0,n1 w0,n )
and B = n(n 1)w0,n2 (w2,n2 2w1,n1 )w0,n + 2n2 w0,n2 w1,n1 (w1,n1 w0,n )
2 =nw0,n2 (2nw1 ,n1 (n 1)w2,n2 w0,n 2w1,n1 w0,n )
which nishes the proof. It is interesting to check that (19) really generalises the corresponding expression for non-rational B ezier curves. Indeed, setting wi = 1, equation (19) becomes P = n(n 1)(P0,n2 2P1,n2 + P2,n2 ). As another application of (11) we combine it with (19) to obtain an expression for the curvature of P (t) dened as P (t ) P (t ) . (t ) = P (t ) 3 Corollary 6. Given the B ezier curve of degree n 2 dened by equations (4) and (6), the curvature of P (t) is =
3 (n 1) w0,n2 w1,n2 w2,n2 w0 ,n (P1,n2 P0,n2 ) (P2,n2 P1,n2 ) . 3 3 n w0,n1 w1,n1 (P1,n1 P0,n1 ) 3
Proof. From (11) and Lemma 4 it follows that P =n =n w0,n1 w1,n1 (P1,n1 P0,n1 ) 2 w0 ,n w0,n1 w1,n1 2 w0 ,n (1 t) w0,n2 w2,n2 (P1,n2 P0,n2 ) + t (P2,n2 P1,n2 ) . w0,n1 w1,n1
Then from (19), P P = n2 w0,n2 w2,n2 A(P1,n2 P0,n2 ) (P2,n2 P1,n2 ) 5 w0 ,n 14
where
2 A =(1 t)w1,n1 (2nw0 ,n1 (n 1)w0,n2 w0,n 2w0,n1 w0,n ) 2 + tw0,n1 (2nw1 ,n1 (n 1)w2,n2 w0,n 2w1,n1 w0,n )
=2nw0,n1 w1,n1 w0,n (n 1)w0,n ((1 t)w0,n2 w1,n1 + tw2,n2 w0,n1 ) 2w0,n1 w1,n1 w0,n =(n 1)w0,n {2w0,n1 w1,n1 (1 t)w0,n2 w1,n1 tw2,n2 w0,n1 } =(n 1)w0,n w1,n2 w0,n . Therefore P P = n2 (n 1) w0,n2 w1,n2 w2,n2 (P1,n2 P0,n2 ) (P2,n2 P1,n2 ). 3 w0 ,n
By substituting this and equation (11) into the denition of (t) we have proved the corollary. Finally, despite even more algebra, we nd the torsion (t) of P dened as (t ) = P (t) P (t).P (t) P (t ) P (t ) 2
in a similar way. We will not prove the details but mention that there exist scalar functions A(t), B (t), C (t) (not necessarily positive) such that P = A(P1,n3 P0,n3 ) + B (P2,n3 P1,n3 ) + C (P3,n3 P2,n3 ).
After calculating A, B , C it can be shown that (P P ).P where R = n3 (n 1)2 (n 2) Therefore, since P P = n2 (n 1) equation (21) follows. w0,n2 w1,n2 w2,n2 (P1,n2 P0,n2 ) (P2,n2 P1,n2 ) 3 w0 ,n = R(P1,n3 P0,n3 ) (P2,n3 P1,n3 ).(P3,n3 P2,n3 ) w0,n3 w1,n3 w2,n3 w3,n3 . 4 w0 ,n
15
5. References G. Farin (1983) Algorithms for rational B ezier curves, Computer-Aided Design, 15, 7377. G. Farin (1988) Curves and surfaces for computer aided geometric design, Academic Press, San Diego. I. Faux & M. Pratt (1979) Computational geometry for design and manufacture, Ellis Horwood, England. D. Filip, R. Magedson & R. Markot (1986) Surface algorithms using bounds on derivatives, Computer Aided Geometric Design, 3, 295311. M. S. Floater (1992) Evaluation and properties of the derivative of a NURBS curve, Mathematical Methods in CAGD, T. Lyche & L. L. Schumaker (eds.), Academic Press, Boston, 2, 261274. L. Piegl (1986) Representation of rational B ezier curves and surfaces by recursive algorithms, Computer-Aided Design, 18, 361366. L. Piegl & W. Tiller (1987) Curve and surface constructions using rational B-splines, Computer-Aided Design, 19, 485498. T. W. Sederberg & R. J. Meyers (1988) Loop detection in surface patch intersections, Computer Aided Geometric Design, 5, 161171. T. W. Sederberg & X. Wang (1987) Rational hodographs, Computer Aided Geometric Design, 4, 333335.
16