Remark Reconsidering the motivating example, we observe that the derivatives are typically not given by the problem specification. However, they can be estimated in a pre-processing step. A good estimate for derivative d i can be obtained by fitting an interpolating quadratic polynomial curve through points p i-1, p i, and p i+1 at knots u i-1, u i, and u i+1 and evaluating the derivative of the interpolating polynomial at u i. 120202: ESM4A - Numerical Methods 331
Summary Bézier curves converge towards equidistantly sampled functions, but do not fulfill interpolation conditions. Hermite interpolation interpolates function values and derivatives. Using interpolated derivatives up to a certain order, one can generate piecewise polynomial curves with continuity at their stitches. Piecewise Hermite interpolation uses Bézier curves for each piece and ensures continuous transitions. Using piecewise interpolation, lower-degree polynomials can be used. Lower-degree polynomials produce less oscillations. 120202: ESM4A - Numerical Methods 332
4.10 Splines 120202: ESM4A - Numerical Methods 333
Motivation We have seen that piecewise polynomial functions of lower degree tend to have less oscillations. We have further seen that we can generate C 1 - continuous functions using cubic polynomials. C k -continuity for k>1 required higher-order polynomials. Moreover, we always had to fix the derivatives at the stitches. Is there a general, more flexible concept of piecewise polynomial curves ensuring C k -continuity without predefining the derivatives at the stitches? 120202: ESM4A - Numerical Methods 334
Definition A function s(u) with domain [a,b] is called a spline of degree k (or of order k+1), if s(u) є C k-1 [a,b] and there are knots a = u 0 < u 1 < < u m = b such that s is a polynomial of degree k on each sub-interval [u i,u i+1 ] for i = 0,,m-1. 120202: ESM4A - Numerical Methods 335
Linear splines Splines of degree 1 are piecewise linear and continuous. Case m=4: 120202: ESM4A - Numerical Methods 336
Natural splines Natural splines of degree k over interval [a,b] are splines of degree k with Natural cubic spline (degree 3): (u 0,u 1,u 2 ) = (-1,0,1): interpolation conditions 120202: ESM4A - Numerical Methods 337
First derivative: Natural splines Continuity: Second derivative: Continuity: 120202: ESM4A - Numerical Methods 338
Natural splines Natural splines conditions: We obtained 8 linear equations with 8 unknown. Solving the system delivers: 120202: ESM4A - Numerical Methods 339
4.10 B-spline Representation 120202: ESM4A - Numerical Methods 340
Definition A spline in B-spline representation is of the form where N im (u) are basis spline functions of degree m with mimimal support. The nodes c i are called control points. The basis splines N im (u) are called B-splines of degree m. B-splines are splines and, thus, are piecewise polynomial of degree m and C m-1 -continuous. 120202: ESM4A - Numerical Methods 341
B-splines Let (u i ) i be a sequence of knots with u i < u i+1 for all i. We define the B-splines of degree 0 over knot sequence (u i ) i as Recursively, we define the B-splines of degree n over knot sequence (u i ) i as with being a local parameter with respect to the support of N i n-1 (u). 120202: ESM4A - Numerical Methods 342
Local parameter Support: Local parameter with respect to the support of N i n-1 (u): 120202: ESM4A - Numerical Methods 343
Examples n=0: n=1: 120202: ESM4A - Numerical Methods 344
Examples n=1: n=2: 120202: ESM4A - Numerical Methods 345
Applet http://i33www.ira.uka.de/applets/mocca/html/noplugin/ BSplineBasis/AppBSplineBasis/index.html 120202: ESM4A - Numerical Methods 346
Multiple knots The recursion still holds when allowing multiple knots, i.e., when u i = u i+1 = = u i+r, with the convention that N ir (u) = 0 for an (r+1)-fold knot. Example: n=1, u i = u i+1 Discontinuity: B-spline N in (u) with an r-fold knot u i is only C n-r -continuous. 120202: ESM4A - Numerical Methods 347
Multiple knots Example: n=2, u i = u i+1 C 0 -continuous at double knot, but not C 1 -continuous. 120202: ESM4A - Numerical Methods 348
Remark Given a knot sequence u 0,,u 2n with n-fold knots u 0 = = u n = 0 and u n+1 = = u 2n = 1. Then, the recursion formula for N 0n (u),, N nn (u) are for u є [0,1] is equivalent to the recursion formula for Bernstein polynomials. As N 00 (u) = B 00 (u), we obtain N in (u) = B in (u) for i=0,,n and any degree n, i.e., Bernstein polynomials are a special case of B-splines. This directly leads to the fact that Bézier curves are a special case of splines in B-spline representation. 120202: ESM4A - Numerical Methods 349
Properties of B-splines N in (u) is piecewise polynomial of degree n. N in (u) is positive in (u i,u i+n+1 ) and zero outside. N in (u) is right-side continuous. B-splines of degree n form a basis of all splines of degree n over a given knot sequence. B-splines fulfill the partition-of-unity property, i.e., i N in (u) = 1 for u є (u n,u m-n ). 120202: ESM4A - Numerical Methods 350
Properties of splines in B-spline representation Recall: Splines in B-spline representation are, in general, not interpolating the control points. They do not even interpolate the endpoints. As B-splines are non-negative and have the partitionof-unity property, the spline curve in B-spline representation lies in the convex hull of the control polygon. 120202: ESM4A - Numerical Methods 351
Applet http://i33www.ira.uka.de/applets/mocca/html/noplugin/ IntBSpline/AppDifferentialGeometry/index.html 120202: ESM4A - Numerical Methods 352