Nothing Special   »   [go: up one dir, main page]

Computer Aided Geometric Design

Download as pdf or txt
Download as pdf or txt
You are on page 1of 277

COMPUTER AIDED GEOMETRIC DESIGN

Thomas W. Sederberg

October 9, 2014
ii

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
T. W. Sederberg iii

Preface

This semester is the 24th time I have taught a course at Brigham Young University titled, “Computer
Aided Geometric Design.” When I first taught such a course in 1983, the field was young enough
that no textbook covered everything that I wanted to teach, and so these notes evolved.
The field now has matured to the point that several semesters worth of valuable material could be
compiled. These notes, admittedly biased towards my own interests, reflect my personal preferences
as to which of that material is most beneficial to students in an introductory course.
I welcome anyone who has an interest in studying this fascinating topic to make free use of these
notes. I invite feedback on typos and on material that could be written more clearly.

Thomas W. Sederberg
Department of Computer Science
Brigham Young University
tom@cs.byu.edu
January 2007

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
iv T. W. Sederberg

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Contents

1 Introduction 1
1.1 Points, Vectors and Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Vector Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Points vs. Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Rotation About an Arbitrary Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.1 Matrix Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Parametric, Implicit, and Explicit Equations . . . . . . . . . . . . . . . . . . . . . . 9
1.5 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.1 Parametric equations of lines . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.2 Implicit equations of lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.3 Distance from a point to a line . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.6 Conic Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.6.1 Parametric equations of conics . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2 Bézier Curves 17
2.1 The Equation of a Bézier Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2 Bézier Curves over Arbitrary Parameter Intervals . . . . . . . . . . . . . . . . . . . . 20
2.3 The de Casteljau Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.4 Degree Elevation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5 The Convex Hull Property of Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . 24
2.6 Distance between Two Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.7 Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.8 Three Dimensional Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.9 Rational Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.9.1 De Casteljau Algorithm and Degree Elevation on Rational Bézier Curves . . 29
2.9.2 First Derivative at the Endpoint of a Rational Bézier Curve . . . . . . . . . . 29
2.9.3 Curvature at an Endpoint of a Rational Bézier Curve . . . . . . . . . . . . . 30
2.10 Continuity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.11 Circular Arcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.12 Reparametrization of Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.13 Advantages of Rational Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.14 Explicit Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.15 Integrating Bernstein polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

v
vi CONTENTS

3 Polynomial Evaluation and Basis Conversion 39


3.1 Horner’s Algorithm in Power Basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2 Horner’s Algorithm in Bernstein Basis . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3 Basis Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.3.2 Closed Form Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4 Forward Differencing 43
4.1 Choosing δ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5 Properties of Blending Functions 47


5.1 Timmer’s Parametric Cubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.2 Ball’s Rational Cubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.3 Overhauser Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

6 B-Spline Curves 55
6.1 Polar Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.1.1 Subdivision of Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2 Knot Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.3 Extracting Bézier Curves from B-splines . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.4 Multiple knots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.5 Periodic B-splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.6 Bézier end conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.7 Knot insertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.8 The de Boor algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.9 Explicit B-splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.10 B-spline hodographs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.11 Symmetric polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.12 Combining Bézier curves into a B-spline . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.13 Knot Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.13.1 Knot Insertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.13.2 Interval Halving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.13.3 Degree-Two B-Splines using Knot Intervals . . . . . . . . . . . . . . . . . . . 70
6.13.4 Hodographs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.13.5 Degree elevation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.14 B-spline Basis Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.14.1 B-Spline Basis-Functions using Knot Intervals . . . . . . . . . . . . . . . . . . 76
6.14.2 Refinement of B-Spline Basis Functions . . . . . . . . . . . . . . . . . . . . . 77
6.14.3 Recurrence Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

7 Planar Curve Intersection 79


7.1 Bezout’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.1.1 Homogeneous coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.1.2 Circular Points at Infinity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.1.3 Homogeneous parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.1.4 The Fundamental Theorem of Algebra . . . . . . . . . . . . . . . . . . . . . . 81
7.2 The Intersection of Two Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.2.1 Homogeneous Points and Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.3 Intersection of a Parametric Curve and an Implicit Curve . . . . . . . . . . . . . . . 82

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
CONTENTS vii

7.3.1 Order of Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83


7.4 Computing the Intersection of Two Bézier Curves . . . . . . . . . . . . . . . . . . . . 84
7.4.1 Timing Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.5 Bézier subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.6 Interval subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.7 Bézier Clipping method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.7.1 Fat Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.7.2 Bézier Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.7.3 Iterating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.7.4 Clipping to other fat lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.7.5 Multiple Intersections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.7.6 Rational Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.7.7 Example of Finding a Fat Line . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.7.8 Example of Clipping to a Fat Line . . . . . . . . . . . . . . . . . . . . . . . . 92

8 Offset Curves 95

9 Polynomial Root Finding in Bernstein Form 97


9.1 Convex Hull Marching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
9.2 Bernstein Combined Subdivide & Derivative Algorithm . . . . . . . . . . . . . . . . 99
9.3 Multiplication of Polynomials in Bernstein Form . . . . . . . . . . . . . . . . . . . . 103
9.4 Intersection between a Line and a Rational Bézier Curve . . . . . . . . . . . . . . . . 103

10 Polynomial Interpolation 105


10.1 Undetermined Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.2 Lagrange Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.3 Newton Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
10.4 Neville’s Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
10.5 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
10.6 Error Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
10.6.1 Chebyshev Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
10.7 Interpolating Points and Normals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

11 Approximation 117
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
11.2 L2 Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
11.3 Approximating a Set of Discrete Points with a B-Spline Curve . . . . . . . . . . . . 118
11.3.1 Parametrization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
11.3.2 Knot vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
11.4 Fairing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
11.4.1 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
11.4.2 Constrained fairing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
11.4.3 Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

12 Interval Bézier Curves 127


12.1 Interval arithmetic and interval polynomials . . . . . . . . . . . . . . . . . . . . . . . 127
12.2 Interval Bézier curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
12.2.1 Affine maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
12.2.2 Centered form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
viii CONTENTS

12.2.3 Error monotonicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135


12.2.4 Envelopes of interval Bézier curves . . . . . . . . . . . . . . . . . . . . . . . . 136
12.2.5 Interval hodographs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
12.3 Approximation by interval polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . 137
12.3.1 Remainder formulae and interval approximants . . . . . . . . . . . . . . . . . 138
12.3.2 Hermite interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
12.3.3 Estimating bounds on derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 141
12.4 Approximation by interval Bézier curves . . . . . . . . . . . . . . . . . . . . . . . . . 142

13 Floating Point Error 145

14 Free-Form Deformation (FFD) 149


14.0.1 Deformed Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

15 TENSOR-PRODUCT SURFACES 155


15.1 Tensor-Product Bézier Surface Patches . . . . . . . . . . . . . . . . . . . . . . . . . . 155
15.2 The de Casteljau Algorithm for Bézier Surface Patches . . . . . . . . . . . . . . . . . 157
15.3 Tangents and Normals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
15.4 Tessellation of Bézier Curves and Surfaces . . . . . . . . . . . . . . . . . . . . . . . . 159
15.4.1 The curve case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
15.4.2 The surface case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
15.5 C n Surface Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
15.6 NURBS Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
15.7 T-Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
15.7.1 Equation of a T-Spline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
15.7.2 T-spline Local Refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
15.7.3 Blending Function Refinement . . . . . . . . . . . . . . . . . . . . . . . . . . 170
15.7.4 T-spline Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
15.7.5 Local Refinement Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
15.7.6 Converting a T-spline into a B-spline surface . . . . . . . . . . . . . . . . . . 173
15.8 Efficient Computation of Points and Tangents on a Bézier surface patch. . . . . . . . 175
15.9 Curvature at the Corner of a Bézier Surface Patch . . . . . . . . . . . . . . . . . . . 178
15.9.1 Curvatures of tensor-product rational Bézier surfaces . . . . . . . . . . . . . 178
15.9.2 Curvatures of triangular rational Bézier surfaces . . . . . . . . . . . . . . . 181
15.9.3 Curvature of an Implicit Surface . . . . . . . . . . . . . . . . . . . . . . . . . 182

16 Computing Points and Tangents on Bézier Surface Patches 183

17 Algebraic Geometry for CAGD 187


17.1 Implicitization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
17.2 Brute Force Implicization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
17.3 Polynomial Resultants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
17.3.1 Definition of the Resultant of Two Polynomials . . . . . . . . . . . . . . . . . 189
17.3.2 Resultant of Two Degree One Polynomials . . . . . . . . . . . . . . . . . . . 190
17.3.3 Resultants of Degree-Two Polynomials . . . . . . . . . . . . . . . . . . . . . . 190
17.3.4 Resultants of Degree-Three Polynomials . . . . . . . . . . . . . . . . . . . . . 192
17.3.5 Resultants of Higher Degree Polynomials . . . . . . . . . . . . . . . . . . . . 193
17.4 Determining the Common Root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
17.5 Implicitization and Inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
CONTENTS ix

17.6 Implicitization in Bézier Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199


17.6.1 Inversion of Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
17.7 Curve Inversion Using Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . 201
17.8 Curve-Curve Intersections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
17.9 Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
17.10Base Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
17.11Ideals and Varieties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
17.11.1 Ideals of Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
17.11.2 Ideals of Polynomials in One Variable . . . . . . . . . . . . . . . . . . . . . . 206
17.11.3 Polynomials in Several Variables . . . . . . . . . . . . . . . . . . . . . . . . . 206
17.11.4 Polynomial Ideals and Varieties . . . . . . . . . . . . . . . . . . . . . . . . . . 208
17.11.5 Gröbner Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

18 Implicitization using Moving Lines 211


18.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
18.1.1 Homogeneous Points and Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 211
18.1.2 Curves and Moving Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
18.1.3 Weights and Equivalency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
18.2 Pencils and Quadratic Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
18.2.1 Pencils of lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
18.2.2 Intersection of Two Pencils . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
18.2.3 Pencils on Quadratic Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
18.3 Moving Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
18.3.1 Bernstein Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
18.3.2 Moving Line which Follows Two Moving Points . . . . . . . . . . . . . . . . . 220
18.3.3 Intersection of Two Moving Lines . . . . . . . . . . . . . . . . . . . . . . . . . 221
18.3.4 Base Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
18.3.5 Axial Moving Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
18.4 Curve Representation with Two Moving Lines . . . . . . . . . . . . . . . . . . . . . . 223
18.4.1 Axial Moving Line on a Curve . . . . . . . . . . . . . . . . . . . . . . . . . . 223
18.4.2 Axial Moving Line on a Double Point . . . . . . . . . . . . . . . . . . . . . . 224
18.4.3 Cubic Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
18.4.4 Quartic Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
18.4.5 General Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
18.4.6 Implicitization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
18.5 Tangent Moving Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
18.5.1 Tangent Moving Lines and Envelope Curves . . . . . . . . . . . . . . . . . . . 230
18.5.2 Reciprocal Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
18.5.3 Tangent Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

19 Genus and Parametrization of Planar Algebraic Curves 237


19.1 Genus and Parametrization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
19.2 Detecting Double Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
19.3 Implicit Curve Intersections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
19.4 Discriminants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
19.5 Parametrizing Unicursal Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
19.6 Undetermined Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
x CONTENTS

20 POLYNOMIAL APPROXIMATION OF RATIONAL CURVES 247


20.1 PLANAR AREAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
20.2 Integrals Involving Plane Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . . . 251
20.3 Error Bounds on Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
20.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
List of Figures

1.1 Equivalent Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2


1.2 Vectors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Vector Addition and Subtraction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Vector Projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Rotation about an Arbitrary Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Rotation about an Arbitrary Axis Using Vector Algebra. . . . . . . . . . . . . . . . . 7
1.7 Line given by A0 + A1 t. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8 Affine parametric equation of a line. . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.9 Line defined by point and normal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.10 Normalized line equation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.1 Examples of cubic Bézier curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17


2.2 Font definition using Bézier curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Bézier Curves in Terms of Center of Mass. . . . . . . . . . . . . . . . . . . . . . . . . 18
2.4 Cubic Bézier blending functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5 Bézier curves of various degree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6 Subdividing a cubic Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.7 Recursively subdividing a quadratic Bézier curve. . . . . . . . . . . . . . . . . . . . . 21
2.8 Subdividing a quadratic Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.9 Degree Elevation of a Bézier Curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.10 Convex Hull Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.11 Difference curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.12 Hodograph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.13 Rational Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.14 Rational curve as the projection of a 3-D curve. . . . . . . . . . . . . . . . . . . . . . 28
2.15 Osculating Circle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.16 Endpoint curvature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.17 C 2 Bézier curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.18 Circular arcs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.19 Circle as Degree 5 Rational Bézier Curve. . . . . . . . . . . . . . . . . . . . . . . . . 34
2.20 Circle with negative weight. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.21 Explicit Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.1 Variation Diminishing Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48


5.2 Timmer’s PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.3 Ball’s Cubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

xi
xii LIST OF FIGURES

5.4 Overhauser curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6.1 Spline and ducks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55


6.2 Polar Labels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.3 Affine map property of polar values. . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.4 Subdividing a cubic Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.5 Böhm algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.6 Double knot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.7 Special B-Spline Curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.8 Knot Insertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.9 B-spline with knot vector [11115555]. . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.10 De Boor algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.11 Sample cubic B-spline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.12 Periodic B-splines labelled with knot intervals . . . . . . . . . . . . . . . . . . . . . . 66
6.13 Periodic B-splines with double and triple knots. . . . . . . . . . . . . . . . . . . . . . 67
6.14 Inferring polar labels from knot intervals. . . . . . . . . . . . . . . . . . . . . . . . . 67
6.15 Knot Insertion using Knot Intervals. . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.16 “Interval Splitting” using Knot Intervals. . . . . . . . . . . . . . . . . . . . . . . . . 68
6.17 “Interval Splitting” using Knot Intervals. . . . . . . . . . . . . . . . . . . . . . . . . 69
6.18 Introducing Zero Knot Intervals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.19 Interval halving for a non-uniform quadratic B-spline curve. . . . . . . . . . . . . . . 70
6.20 Interval halving for a non-uniform cubic B-spline curve. . . . . . . . . . . . . . . . . 70
6.21 Quadratic B-Spline Curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.22 Interval Splitting of a Quadratic B-Spline Curve. . . . . . . . . . . . . . . . . . . . . 71
6.23 Interval Splitting of a Quadratic B-Spline Curve. . . . . . . . . . . . . . . . . . . . . 72
6.24 Hodograph of a Degree 3 Polynomial B-Spline Curve. . . . . . . . . . . . . . . . . . 72
6.25 Finding the Control Points of a B-Spline Hodograph. . . . . . . . . . . . . . . . . . . 73
6.26 Degree elevating a degree one and degree two B-spline. . . . . . . . . . . . . . . . . . 74
6.27 Degree elevating a degree three B-spline. . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.28 Cubic B-Spline Curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.29 Basis function B33 (t). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.30 Sample Cubic B-Spline Curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.31 B-Spline Basis Function for Control Point Pi in Figure 6.30. . . . . . . . . . . . . . . 76

7.1 Convex Hulls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85


7.2 Three iterations of Bézier subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.3 Interval preprocess and subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.4 Fat line bounding a quartic curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.5 Bézier curve/fat line intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.6 Explicit Bézier curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.7 After first Bézier clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.8 Two intersections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.9 Two intersections, after a split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.10 Example of how to find fat lines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.11 Clipping to a fat line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.12 Clipping to Lmax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
7.13 Clipping example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
7.14 Additional examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
LIST OF FIGURES xiii

8.1 Offset Curves. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95


8.2 Offset Curves in which the Offset Radius Exceeds the Radius of Curvature for a
Portion of the Base Curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

9.1 Bernstein root finding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100


9.2 Root isolation heuristic (a-d). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3 Root isolation heuristic (e-h). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

10.1 Interpolating Four Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105


10.2 Interpolating Four Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.3 Error Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.4 Piecewise linear approximation of a Bézier curve . . . . . . . . . . . . . . . . . . . . 113
10.5 Two cases of (x − x0 )(x − x1 ) · · · (x − x9 ) for 0 ≤ x ≤ 1. . . . . . . . . . . . . . . . . 115

11.1 Uniform vs. bad parametrization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120


11.2 Arc length vs. bad parametrization. . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
11.3 Uniform vs. bad knots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
11.4 The fairing effect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
11.5 The shrank curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
11.6 The fairing effect of bad parameter. . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.7 Fairing and interpolation with different constant. . . . . . . . . . . . . . . . . . . . . 125
11.8 Constrained fairing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.9 Constrained fairing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

12.1 A cubic interval Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130


12.2 The affine map of two scalar points. . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
12.3 The affine map of two scalar intervals. . . . . . . . . . . . . . . . . . . . . . . . . . . 131
12.4 The affine map of two vector intervals. . . . . . . . . . . . . . . . . . . . . . . . . . . 132
12.5 Interval de Casteljau algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
12.6 The envelope of an interval Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . 136
12.7 Approximate arc length parametrization of circle. . . . . . . . . . . . . . . . . . . . . 143

13.1 Affine map in floating point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146


13.2 Affine map in floating point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

14.1 FFD example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149


14.2 FFD example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
14.3 FFD local coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
14.4 FFD undisplaced control points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
14.5 Continuity control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
14.6 FFD Applied to a Grid of Lines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
14.7 Control points of deformed line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
14.8 FFD Applied to a horizontal line t = .3 . . . . . . . . . . . . . . . . . . . . . . . . . 153
14.9 Control points of deformed line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

15.1 Bézier surface patch of degree 2 × 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . 156


15.2 Surface in Figure 15.1.a viewed as a family of t-iso-parameter curves. . . . . . . . . . 157
15.3 Applying the de Casteljau algorithm to the surface in Figure 15.1.a. . . . . . . . . . 158
15.4 Partial derivative vectors for P[0,1]×[0,1] (s, t)(assuming weights are unity). . . . . . . 158

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
xiv LIST OF FIGURES

15.5 Surface Control Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161


15.6 Teapot modeled using 32 bicubic Bézier surface patches . . . . . . . . . . . . . . . . 163
15.7 Two C n bicubic Bézier surface patches. . . . . . . . . . . . . . . . . . . . . . . . . . 163
15.8 Knot insertions into a NURBS surface. . . . . . . . . . . . . . . . . . . . . . . . . . . 164
15.9 Splitting a NURBS surface into Bézier patches. . . . . . . . . . . . . . . . . . . . . . 164
15.10Head modeled (a) as a NURBS with 4712 control points and (b) as a T-spline with
1109 control points. The red NURBS control points are superfluous. . . . . . . . . . 165
15.11Car door modeled as a NURBS and as a T-spline. . . . . . . . . . . . . . . . . . . . 165
15.12NURBS head model, converted to a T-spline. . . . . . . . . . . . . . . . . . . . . . . 165
15.13A gap between two B-spline surfaces, fixed with a T-spline. . . . . . . . . . . . . . . 166
15.14Pre-image of a T-mesh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.15Pre-image of a T-mesh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.16Knot lines for blending function Bi (s, t). . . . . . . . . . . . . . . . . . . . . . . . . . 168
15.17Example T-Mesh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
15.18Sample Refinement of B1 (s, t). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
15.19Nested sequence of T-spline spaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
15.20Local refinement example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
15.21Semi-standard T-splines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
15.22Curve example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
15.23Curvature of a Bézier curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
15.24Part of a rectangular mesh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
15.25Part of a triangular mesh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

16.1 Curve example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

17.1 Two cubic curves intersecting nine times . . . . . . . . . . . . . . . . . . . . . . . . . 203

18.1 Intersection of Two Pencils of Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . 212


18.2 Dual Point and Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
18.3 Pencil of Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
18.4 Pencil of Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
18.5 Pencil of Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
18.6 Intersection of Two Pencils of Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
18.7 Rational Quadratic Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
18.8 Quadratic Bézier Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
18.9 Cubic Moving Line which Follow Linear and Quadratic Moving Points . . . . . . . . 221
18.10Intersection of Linear and Quadratic Moving Lines . . . . . . . . . . . . . . . . . . . 222
18.11Cubic Bézier Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
18.12Quartic Bézier Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
18.13Quartic Bézier Curve with a Triple Point . . . . . . . . . . . . . . . . . . . . . . . . 227
18.14Envelope curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
18.15Dual and Reciprocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
18.16Cusp ⇔ Inflection Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
18.17Crunode ⇔ Double Tangent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

19.1 Irreducible Cubic Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238


19.2 Crunode: x3 + 9x2 − 12y 2 = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
19.3 Cusp: x3 − 3y 2 = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
19.4 Acnode: x3 − 3x2 − 3y 2 = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
LIST OF FIGURES xv

19.5 Circle and Hyperbola . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241


19.6 Parametrizing a Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
19.7 Parametrizing a Cubic Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

20.1 Hybrid curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248


20.2 Hybrid curves after subdivision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
20.3 Area under cubic Bézier curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
20.4 Area of cubic Bézier sector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
20.5 Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
20.6 Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 1

Introduction

Computer aided geometric design (CAGD) concerns itself with the mathematical description of
shape for use in computer graphics, manufacturing, or analysis. It draws upon the fields of geometry,
computer graphics, numerical analysis, approximation theory, data structures and computer algebra.
CAGD is a young field. The first work in this field began in the mid 1960s. The term computer
aided geometric design was coined in 1974 by R.E. Barnhill and R.F. Riesenfeld in connection with
a conference at the University of Utah.
This chapter presents some basic background material such as vector algebra, equations for lines
and conic sections, homogeneous coordinates.

1.1 Points, Vectors and Coordinate Systems


Consider the simple problem of writing a computer program which finds the area of any triangle.
We must first decide how to uniquely describe the triangle. One way might be to provide the lengths
l1 , l2 , l3 of the three sides, from which Heron’s formula yields
l1 + l2 + l3
Area = s(s − l1 )(s − l2 )(s − l3 ), s=
p
.
2
An alternative way to describe the triangle is in terms of its vertices. But while the lengths of
the sides of a triangle are independent of its position, we can specify the vertices to our computer
program only with reference to some coordinate system — which can be defined simply as any
method for representing points with numbers.
Note that a coordinate system is an artificial devise which we arbitrarily impose for the purposes
at hand. Imagine a triangle cut out of paper and lying on a flat table in the middle of a room.
We could define a Cartesian coordinate system whose origin lies in a corner of the room, and whose
coordinate axes lie along the three room edges which meet at the corner. We would further specify
the unit of measurement, say centimeters. Then, each vertex of our triangle could be described in
terms of its respective distance from the two walls containing the origin and from the floor. These
distances are the Cartesian coordinates (x, y, z) of the vertex with respect to the coordinate system
we defined.
Vectors A vector can be pictured as a line segment of definite length with an arrow on one end.
We will call the end with the arrow the tip or head and the other end the tail.
Two vectors are equivalent if they have the same length, are parallel, and point in the same
direction (have the same sense) as shown in Figure 1.1. For a given coordinate system, we can

1
2 Points, Vectors and Coordinate Systems

V
V

Figure 1.1: Equivalent Vectors

describe a three-dimensional vector in the form (a, b, c) where a (or b or c) is the distance in the x
(or y or z) direction from the tail to the tip of the vector.

j y

ck

i bj
k V = a i+ b j + c k

ai

X x

z
Z

(a) Unit Vectors. (b) Vector in Component Form.

Figure 1.2: Vectors.

Unit Vectors The symbols i, j, and k denote vectors of “unit length” (based on the unit of
measurement of the coordinate system) which point in the positive x, y, and z directions respectively
(see Figure 1.2.a).
Unit vectors allow us to express a vector in component form (see Figure 1.2.b):

P = (a, b, c) = ai + bj + ck.

An expression such as (x, y, z) can be called a triple of numbers. In general, an expression


(x1 , x2 , . . . , xn ) is an n-tuple, or simply a tuple. As we have seen, a triple can signify either a point
or a vector.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Vector Algebra 3

Relative Position Vectors Given two points P1 and P2 , we can define

P2/1 = P2 − P1

as the vector pointing from P1 to P2 . This notation P2/1 is widely used in engineering mechanics,
and can be read “the position of point P2 relative to P1 ”
In our diagrams, points will be drawn simply as dots or small circles, and vectors as line segments
with single arrows. Vectors and points will both be denoted by bold faced type.

1.2 Vector Algebra


Given two vectors P1 = (x1 , y1 , z1 ) and P2 = (x2 , y2 , z2 ), the following operations are defined:
Addition:
P1 + P2 = P2 + P1 = (x1 + x2 , y1 + y2 , z1 + z2 )

A
A

B -B
A+B
B B+A=A+B
A-B

(a) Vector Addition. (b) Vector Subtraction.

Figure 1.3: Vector Addition and Subtraction.

Subtraction:
P1 − P2 = (x1 − x2 , y1 − y2 , z1 − z2 )

Scalar multiplication:
cP1 = (cx1 , cy1 , cz1 )

Length of a Vector q
|P1 | = x21 + y12 + z12

A vector of length one is called a unit vector.

P1
|P1 |

is a unit vector in the direction of P1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
4 Vector Algebra

Dot Product The dot product of two vectors is defined


P1 · P2 = |P1 ||P2 | cos θ (1.1)
where θ is the angle between the two vectors. Since the unit vectors i, j, k are mutually perpendicular,
i·i=j·j=k·k=1
i · j = i · k = j · k = 0.
The dot product obeys the distributive law
P1 · (P2 + P3 ) = P1 · P2 + P1 · P3 ,
As a result of the distributive law,
P1 · P2 = (x1 i + y1 j + z1 k) · (x2 i + y2 j + z2 k)
= (x1 ∗ x2 + y1 ∗ y2 + z1 ∗ z2 ) (1.2)
(1.2) enables us to compute the angle between any two vectors. From (1.1),
P1 · P2
 
θ = cos−1
.
|P1 ||P2 |
Example. Find the angle between vectors (1, 2, 4) and (3, −4, 2).
Answer.
P1 · P2
 
θ = cos −1
|P1 ||P2 |
(1, 2, 4) · (3, −4, 2)
 
= cos −1
|(1, 2, 4)||(3, −4, 2)|
3
 
= cos −1
√ √
21 29
≈ 83.02◦

Figure 1.4: Vector Projection

An important application of dot products is in computing the projection of one vector onto
another vector. As illustrated in Figure 1.4, vector R is the projection of vector P onto vector Q.
Since
P·Q
|R| = |P| cos θ =
|Q|

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Vector Algebra 5

we have
Q P·Q Q P·Q
R = |R| = = Q.
|Q| |Q| |Q| Q·Q
Example. Find the projection of P = (3, 2, 1) onto Q = (3, 6, 6).
Answer.
P·Q
R = Q
Q·Q
(3, 2, 1) · (3, 6, 6)
= (3, 6, 6)
(3, 6, 6) · (3, 6, 6)
27
= (3, 6, 6)
81
= (1, 2, 2)

Cross Product: The cross product P1 × P2 is a vector whose magnitude is

|P1 × P2 | = |P1 ||P2 | sin θ

(where again θ is the angle between P1 and P2 ), and whose direction is mutually perpendicular to
P1 and P2 with a sense defined by the right hand rule as follows. Point your fingers in the direction
of P1 and orient your hand such that when you close your fist your fingers pass through the direction
of P2 . Then your right thumb points in the sense of P1 × P2 .
From this basic definition, one can verify that

P1 × P2 = −P2 × P1 ,

i × j = k, j × k = i, k×i=j
j × i = −k, k × j = −i, i × k = −j.
The cross product obeys the distributive law

P1 × (P2 + P3 ) = P1 × P2 + P1 × P3 .

This leads to the important relation

P1 × P2 = (x1 i + y1 j + z1 k) × (x2 i + y2 j + z2 k)
= (y1 z2 − y2 z1 , x2 z1 − x1 z2 , x1 y2 − x2 y1 )
i j k

= x1 y1 z1 (1.3)

x2 y2 z2

Area of a Triangle. Cross products have many important uses, such as finding a vector which is
mutually perpendicular to two other vectors and finding the area of a triangle which is defined by
three points P1 , P2 , P3 .
1 1
Area = |P1/2 ||P1/3 | sin θ1 = |P1/2 × P1/3 | (1.4)
2 2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
6 Rotation About an Arbitrary Axis

For example, the area of a triangle with vertices P1 = (1, 1, 1), P2 = (2, 4, 5), P3 = (3, 2, 6) is

1
Area = |P1/2 × P1/3 |
2
1
= |(1, 3, 4) × (2, 1, 5)|
2
1 1p 2
= |(11, 3, −5)| = 11 + 32 + (−5)2
2 2
≈ 6.225

1.2.1 Points vs. Vectors


A point is a geometric entity which connotes position, whereas a vector connotes direction and mag-
nitude. From a purely mathematical viewpoint, there are good reasons for carefully distinguishing
between triples that refer to points and triples that signify vectors [Goldman ’85]. However, no
problem arises if we recognize that a triple connoting a point can be interpreted as a vector from
the origin to the point. Thus, we could call a point an absolute position vector and the difference
between two points a relative position vector. These phrases are often used in engineering mechanics,
where vectors are used to express quantities other than position, such as velocity or acceleration.

1.3 Rotation About an Arbitrary Axis

P’
! P

y n
z x
B

Figure 1.5: Rotation about an Arbitrary Axis

The problem of computing a rotation about an arbitrary axis is fundamental to CAGD and
computer graphics. The standard solution to this problem as presented in most textbooks on com-
puter graphics involves the concatenation of seven 4 × 4 matrices. We present here a straightforward
solution comprised of the four simple vector computations in equations (1.6) through (1.9) — a
compelling example of the power of vector algebra.
Figure 1.5 shows a point P which we want to rotate an angle θ about an axis that passes through
B with a direction defined by unit vector n. So, given the angle θ, the unit vector n, and Cartesian
coordinates for the points P and B, we want to find Cartesian coordinates for the point P0 .
The key insight needed is shown in Figure 1.6.a.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Rotation About an Arbitrary Axis 7

v
v P’
r
r v sin! !
C P
u
! u
C u cos!

y n
z x

(a) Key Insight. (b) Labels.

Figure 1.6: Rotation about an Arbitrary Axis Using Vector Algebra.

Let u and v be any two three-dimensional vectors that satisfy u · v = 0 (that is, they are
perpendicular) and |u| = |v| 6= 0 (that is, they are they same length but not necessarily unit
vectors). We want to find a vector r that is obtained by rotating u an angle θ in the plane defined
by u and v. As suggested in Figure 1.6,

r = u cos θ + v sin θ. (1.5)

With that insight, it is easy to compute a rotation about an arbitrary axis. Note that (C − B)
is the projection of vector (P − B) onto the unit vector n. Referring to the labels in Figure 1.6.b,
we compute
C = B + [(P − B) · n]n. (1.6)
u=P−C (1.7)
v =n×u (1.8)
Then, r is computed using equation (1.5), and

P0 = C + r. (1.9)

Example
Find the coordinates of a point (5, 7, 3) after it is rotated an angle θ = 90◦ about an axis that points
in the direction (2, 1, 2) and that passes through the point (1, 1, 1).
Answer:
n = ( 32 , 31 , 23 ).

C = B + [(P − B) · n]n
2 1 2 2 1 2
= (1, 1, 1) + [((5, 7, 3) − (1, 1, 1)) · ( , , )]( , , )
3 3 3 3 3 3
= (5, 3, 5)
(1.10)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
8 Rotation About an Arbitrary Axis

u = P − C = (0, 4, −2)
10 4 8
v = n × u = (− , , ).
3 3 3
r = u cos θ + v sin θ = u · 0 + v · 1 = v.

1.3.1 Matrix Form


It is possible to take these simple vector equations and to create from them a single 4 × 4 transfor-
mation matrix for rotation about an arbitrary axis. While this is useful to do in computer graphics
(where, in fact, this matrix is typically created by concatenating seven 4 × 4 matrices), the simple
vector equations we just derived suffice for many applications. The derivation of this matrix is
presented here for your possible reference. We will not be using it in this course.
Let P = (x, y, z), P0 = (x0 , y 0 , z 0 ), B = (Bx , By , Bz ), and n = (nx , ny , nz ). We seek a 4 × 4
matrix M such that    0 
 x   x 
  
  0 
y y
 
M = 0
 z   z 
1 1

  
  

(Cx , Cy , Cz ) = (Bx , By , Bz ) + [xnx + yny + znz − B · n](nx , ny , nz ) (1.11)

Cx = xn2x + ynx ny + znx nz + Bx − (B · n)nx (1.12)


Cy = xnx ny + yn2y + zny nz + By − (B · n)ny (1.13)
Cz = xnx nz + yny nz + zn2z + Bz − (B · n)nz (1.14)

u = (x, y, z) − (Cx , Cy , Cz ) (1.15)

ux = x(1 − n2x ) − ynx ny − znx nz + (B · n)nx − Bx (1.16)


uy = −xnx ny + y(1 − n2y ) − zny nz + (B · n)ny − By (1.17)
uz = −xnx nz − yny nz + z(1 − n2z ) + (B · n)nz − Bz (1.18)

vx = ny uz − nz uy (1.19)
vy = nz ux − nx uz (1.20)
vz = nx uy − ny ux (1.21)

rx = ux cos θ + (ny uz − nz uy ) sin θ (1.22)


ry = uy cos θ + (nz ux − nx uz ) sin θ (1.23)
rz = uz cos θ + (nx uy − ny ux ) sin θ (1.24)

(x0 , y 0 , z 0 ) = (Cx + rx , Cy + ry , Cz + rz ) (1.25)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Parametric, Implicit, and Explicit Equations 9

x0 = xn2x + ynx ny + znx nz + Bx − (B · n)nx + (1.26)


[x(1 − n2x ) − ynx ny − znx nz + (B · n)nx − Bx ] cos θ +
ny [−xnx nz − yny nz + z(1 − n2z ) + (B · n)nz − Bz ] sin θ −
nz [−xnx ny + y(1 − n2y ) − zny nz + (B · n)ny − By ] sin θ

x0 = x[n2x + (1 − n2x ) cos θ] + y[nx ny (1 − cos θ) − nz sin θ]


+ z[nx nz (1 − cos θ) + ny sin θ] + (Bx − (B · n)nx )(1 − cos θ) + (nz By − ny Bz ) sin θ.

Since n2x + n2y + n2z = 1, (1 − n2x ) = n2y + n2z . In like manner we can come up with an expression for
y 0 and z 0 , and our matrix M is thus

nx + (n2y + n2z ) cos θ nx ny (1 − cos θ) − nz sin θ nx nz (1 − cos θ) + ny sin θ


 2 
T1
 nx ny (1 − cos θ) + nz sin θ n2y + (n2x + n2z ) cos θ ny nz (1 − cos θ) − nx sin θ T2 
 (1.27)
 nx nz (1 − cos θ) − ny sin θ ny nz (1 − cos θ) + nx sin θ n2z + (n2x + n2y ) cos θ

T3 
0 0 0 1

with
T1 = (Bx − (B · n)nx )(1 − cos θ) + (nz By − ny Bz ) sin θ
T2 = (By − (B · n)ny )(1 − cos θ) + (nx Bz − nz Bx ) sin θ
T3 = (Bz − (B · n)nz )(1 − cos θ) + (ny Bx − nx By ) sin θ

1.4 Parametric, Implicit, and Explicit Equations


There are basically three types of equations that can be used to define a planar curve: parametric,
implicit, and explicit. The parametric equation of a plane curve takes the form

x(t) y(t)
x = y = . (1.28)
w(t) w(t)

The implicit equation of a curve is of the form

f (x, y) = 0. (1.29)

An explicit equation of a curve is a special case of both the parametric and implicit forms:

y = f (x). (1.30)

In these notes, we restrict ourselves to the case where the functions x(t), y(t), w(t), f (x) and f (x, y)
are polynomials.
Any curve that can be expressed parametrically as in equation (1.28) is referred to as a rational
curve. In the classical algebraic geometry literature, a rational curve is sometimes called a unicursal
curve, which means that it can be sketched in its entirety without removing one’s pencil from the
paper. In computer aided geometric design, rational curves are often called rational parametric
curves. The case where w(t) ≡ 1 is called a polynomial parametric curve (or a non-rational
parametric curve). A curve that can be expressed in the form of equation (1.29) is known as a
planar algebraic curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
10 Lines

The parametric equation of a curve has the advantage of being able to quickly compute the (x, y)
coordinates of points on the curve for plotting purposes. Also, it is simple to define a curve segment
by restricting the parameter t to a finite range, for example 0 ≤ t ≤ 1. On the other hand, the
implicit equation of a curve enables one to easily determine whether a given point lies on the curve,
or if not, which side of the curve it lies on. Chapter 17 shows that it is always possible to compute
an implicit equation for a parametric curve. It is trivial to convert en explicit equation of a curve
into a parametric equation (x = t, y = y(x)) or into an implicit equation (f (x) − y = 0). However,
a curve defined by an implicit or parametric equation cannot in general be converted into explicit
form.
A rational surface is one that can be expressed

x(s, t) y(s, t) z(s, t)


x = y = z = (1.31)
w(s, t) w(s, t) w(s, t)

where x(s, t), y(s, t), z(s, t) and w(s, t) are polynomials. Also, a surface that can be expressed by
the equation
f (x, y, z) = 0 (1.32)

where f (x, y, z) is a polynomial is called an algebraic surface.


A rational space curve is one that can be expressed by the parametric equations

x(t) y(t) z(t)


x = y = z = . (1.33)
w(t) w(t) w(t)

The curve of intersection of two algebraic surfaces is an algebraic space curve.

1.5 Lines
The simplest case of a curve is a line. Even so, there are several different equations that can be used
to represent lines.

1.5.1 Parametric equations of lines


Linear parametric equation

A line can be written in parametric form as follows:

x = a0 + a1 t; y = b0 + b1 t

In vector form,
a0 + a1 t
   
x(t)
P(t) = = = A0 + A1 t. (1.34)
y(t) b0 + b1 t

In this equation, A0 is a point on the line and A1 is the direction of the line (see Figure 1.7)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Lines 11

A1

A0

Figure 1.7: Line given by A0 + A1 t.

P1
2/3
P1
t = t1
t=4
1/3
P0
P0 t=2
t = t0
t=1

(t1 −t)P0 +(t−t0 )P1


(a) Line given by P(t) = t1 −t0
. (b) Affine Example.

Figure 1.8: Affine parametric equation of a line.

Affine parametric equation of a line


A line can also be expressed
(t1 − t)P0 + (t − t0 )P1
P(t) = (1.35)
t1 − t0
where P0 and P1 are two points on the line and t0 and t1 are any parameter values. Note that
P(t0 ) = P0 and P(t1 ) = P1 . Note in Figure 1.8.a that the line segment P0 –P1 is defined by
restricting the parameter:
t0 ≤ t ≤ t1 .
Sometimes this is expressed by saying that the line segment is the portion of the line in the parameter
interval or domain [t0 , t1 ].
We will see that the line in Figure 1.8.a is actually a degree one Bézier curve. Most commonly,
we have t0 = 0 and t1 = 1 in which case

P(t) = (1 − t)P0 + tP1 . (1.36)

Equation 1.36 is called an affine equation, whereas equation 1.34 is called a linear equation.
An affine equation is coordinate system independent, and is mainly concerned with ratios and
proportions. An affine equation can be thought of as answering the question: “If a line is defined
through two points P0 and P1 , and if point P0 corresponds to parameter value t0 and point P1
corresponds to parameter value t1 , what point corresponds to an arbitrary parameter value t?”
Figure 1.8.b shows a line on which P0 corresponds to parameter t = t0 = 1 and P1 is assigned

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
12 Lines

parameter value t = t1 = 4. For example, the point corresponding to t = 2 is one third of the way
from P0 to P1 .
Note that an affine equation can be derived from any two points on a line, given the parameter
values for those points. If P(α) is the point corresponding to parameter value t = α and if P(β)
is the point corresponding to parameter value t = β (α 6= β), then the point corresponding to
parameter value γ is
γ−α (β − γ)P(α) + (γ − α)P(β)
P(γ) = P(α) + [P(β) − P(α)] =
β−α β−α

Rational parametric equations


A line can also be defined using the following parametric equations:
a0 + a1 t b0 + b1 t
x= ; y= . (1.37)
d0 + d1 t d0 + d1 t
This is often called rational or fractional parametric equations.
Recall that the homogeneous Cartesian coordinates (X, Y, W ) of a point are related to its Carte-
sian coordinates by
X Y
(x, y) = ( , ).
W W
Thus, we can rewrite equation 1.37 as
X = a0 + a1 t; Y = b0 + b1 t; W = d0 + d1 t.
This equation can be further re-written in terms of homogeneous parameters (T, U ) where t = U
T
.
Thus,
T T T
X = a0 + a1 ; Y = b0 + b1 ; W = d0 + d1 .
U U U
But since we can scale (X, Y, W ) without changing the point (x, y) which it denotes, we can scale
by U to give
X = a0 U + a1 T ; Y = b0 U + b1 T ; W = d0 U + d1 T.

1.5.2 Implicit equations of lines


A line can also be expressed using an implicit equation:
f (x, y) = ax + by + c = 0; or F (X, Y, W ) = aX + bY + cW = 0.
The line defined by an implicit equation is the set of all points which satisfy the equation f (x, y) = 0.
An implicit equation for a line can be derived given a point P0 = (x0 , y0 ) on the line and the
normal vector n = ai + bj. As shown in Figure 1.9, a point P = (x, y) is on this line if
(P − P0 ) · n = 0
from which
f (x, y) = (x − x0 , y − y0 ) · (a, b) = ax + by − (ax0 + by0 ) = 0. (1.38)
From equation 1.38, a line whose implicit equation is ax+by+c = 0 has the normal vector n = ai+bj.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Lines 13

n
P
P - P0 line

P0 (P - P0) • n = 0

Figure 1.9: Line defined by point and normal.

Implicit equation of a line through two points

Three points (X1 , Y1 , W1 ), (X2 , Y2 , W2 ) and (X3 , Y3 , W3 ) are collinear if



X1 Y1 W1
= 0.

X2 Y2 W2

X3 Y3 W3

Thus, the equation of the line through two points is



X Y W
= (Y1 W2 − Y2 W1 )X + (X2 W1 − X1 W2 )Y + (X1 Y2 − X2 Y1 )W = 0.

X1 Y1 W1

X2 Y2 W2

1.5.3 Distance from a point to a line


If n = ai + bj is a unit vector (that is, if a2 + b2 = 1), then the value f (x, y) in equation 1.38 indicates
the signed perpendicular distance of a point (x, y) to the line. This can be seen from equation 1.38
and Figure 1.9. The dot product (P − P0 ) · n is the length of the projection of vector (P − P0 ) onto
the unit normal n, which is the perpendicular distance from P to the line.
Since the coefficients of an implicit equation can be uniformly scaled without changing the curve
(because if f (x, y) = 0, then c × f (x, y) = 0 also), the implicit equation of a line can always be
normalized:

a b c
f (x, y) = a0 x + b0 y + c0 = √ x+ √ y+ √ = 0.
a2 + b2 a2 + b2 a2 + b2

Then, f (x, y) is the signed distance from the point (x, y) to the line, with all points on one side
of the line having f (x, y) > 0 and the other side having f (x, y) < 0. Note that |c0 | = |f (0, 0)| is
the distance from the origin to the line. Thus, if c = 0, the line passes through the origin. The
coefficients a0 and b0 relate to the slope of the line. Referring to Figure 1.10, a0 = cos(θ), b0 = sin(θ),
and c0 = −p.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
14 Conic Sections

p
θ
x

Figure 1.10: Normalized line equation.

1.6 Conic Sections


A conic section (or, simply conic) is any degree two curve. Any conic can be expressed using a
degree two implicit equation:

ax2 + bxy + cy 2 + dx + ey + f = 0

or, in homogeneous form:

aX 2 + bXY + cY 2 + dXW + eY W + f W 2 = 0. (1.39)

Conics can be classified as hyperbolas, parabolas and ellipses (of which the circle is a special case).
What distinguishes these cases is the number of real points at which the curve intersects the line
at infinity W = 0. A hyperbola intersects W = 0 in two real points. Those points are located an
infinite distance along the asymptotic directions. A parabola is tangent to the line at infinity, and
thus has two coincident real intersection points. This point is located an infinite distance along the
parabola’s axis of symmetry. Ellipses do not intersect the line at infinity at any real point — all real
points on an ellipse are finite.
To determine the number of real points at which a conic intersects the line at infinity, simply
intersect equation 1.39 with the line W = 0 by setting W = 0 to get:

aX 2 + bXY + cY 2 = 0

from which √
Y −b ± b2 − 4ac
= .
X 2c
The two values Y /X are the slopes of the lines pointing to the intersections of the conic with the
line at infinity. Thus, if b2 − 4ac > 0, there are two distinct real intersections and the conic is a
hyperbola. If b2 − 4ac = 0, there are two coincident real intersections and the conic is a parabola,
and if b2 − 4ac < 0, there are no real intersections and the conic is an ellipse. The value b2 − 4ac is
known as the discriminant of the conic.

1.6.1 Parametric equations of conics


The parametric equation of any conic can be expressed:
a2 t2 + a1 t + a0 b2 t2 + b1 t + b0
x= ; y= .
d2 t2 + d1 t + d0 d2 t2 + d1 t + d0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Conic Sections 15

or, in homogeneous form,


X = a2 T 2 + a1 T U + a0 U 2 ;
Y = b2 T 2 + b1 T U + b0 U 2 ;
W = d2 T 2 + d1 T U + d0 U 2 .
It is also possible to classify a conic from its parametric equation. We again identify the points at
which the conic intersects the line at infinity. In the parametric form, the only places at which (x, y)
can be infinitely large is at parameter values of t for which

d2 t2 + d1 t + d0 = 0.

Thus, we note that d21 − 4d0 d2 serves the same function as the discriminant of the implicit equation.
If d21 − 4d0 d2 > 0, there are two real, distinct values of t at which the conic goes to infinity and
the curve is a hyperbola. If d21 − 4d0 d2 < 0, there are no real values of t at which the conic goes
to infinity and the curve is an ellipse. If d21 − 4d0 d2 = 0, there are two real, identical values of t at
which the conic goes to infinity and the curve is a parabola.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
16 Conic Sections

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 2

Bézier Curves

Bézier curves are named after their inventor, Dr. Pierre Bézier, an engineer with the Renault car
company who set out in the early 1960’s to develop a curve formulation for use in shape design
that would be intuitive enough for designers and artists to use, without requiring a background in
mathematics.

Figure 2.1: Examples of cubic Bézier curves.

Figure 2.1 shows three different Bézier curves, with their corresponding control polygons. Each
control polygon is comprised of four control points that are connect with line segments. (These
control polygons are not closed, and might more properly be called polylines.) The beauty of the
Bézier representation is that a Bézier curve mimics the shape of its control polygon. A Bézier
curve passes through its first and last control points, and is tangent to the control polygon at those
endpoints. An artist can quickly master the process of designing shapes using Bézier curves by
moving the control points, and most 2D drawing systems like Adobe Illustrator use Bézier curves.
Complicated shapes can be created by using a sequence of Bézier curves. Since Bézier curves are
tangent to their control polygons, it is easy to join together two Bézier curves such that they are
tangent continuous. Figure 2.2 shows the outline of a letter “g” created using several Bézier curves.
All PostScript font outlines are defined using Bézier curves. Hence, as you read these notes, you are
gazing upon Bézier curves!
Although Bézier curves can be used productively by artists who have little mathematical training,

17
18 The Equation of a Bézier Curve

Figure 2.2: Font definition using Bézier curves.

one of the main objectives in this course is to study the underlying mathematics. These notes attempt
to show that the power and elegance of Bézier curves are matched by the beauty of the underlying
mathematics.

2.1 The Equation of a Bézier Curve


The equation of a Bézier curve is similar to the equation for the center of mass of a set of point
masses. Consider the four masses m0 , m1 , m2 , and m3 in Figure 2.3.a located at points P0 , P1 , P2 ,
P3 .

P1 P2 P1 P2

P0 P3 P0 P3
(a) Center of mass of four points. (b) Cubic Bézier Curve.

Figure 2.3: Bézier Curves in Terms of Center of Mass.

The equation for the center of mass is


m0 P0 + m1 P1 + m2 P2 + m3 P3
P = .
m0 + m1 + m2 + m3
Next, imagine that instead of being fixed, constant values, each mass varies as a function of a
parameter t. Specifically, let
m0 (t) = (1 − t)3 , m1 (t) = 3t(1 − t)2 , m2 (t) = 3t2 (1 − t), m3 (t) = t3 . (2.1)
Now, for each value of t, the masses assume different weights and their center of mass changes
continuously. As t varies between 0 and 1, a curve is swept out by the moving center of mass.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
The Equation of a Bézier Curve 19

Figure 2.3.b shows the Bézier curve that results when the point masses in Figure 2.3.a are taken as
control points. This curve is a cubic Bézier curve — cubic because the mass equations are degree
three polynomials in t.
Notice that the mass equations in (2.1) sum identically to one:

(1 − t)3 + 3t(1 − t)2 + 3t2 (1 − t) + t3 = [(1 − t) + t]3 = 13 ≡ 1,

and so we can write the equation of this Bézier curve as P(t) = m0 (t)P0 + m1 (t)P1 + m2 (t)P2 + m3 (t)P3 .
The mass functions are plotted in the graph in Figure 2.4. Note that when t = 0, m0 = 1 and

m
1
m0 m3

m1 m2

t
0
0 1

Figure 2.4: Cubic Bézier blending functions.

m1 = m2 = m3 = 0. This explains why the curve passes through P0 . When t = 1, m3 = 1 and


m0 = m1 = m2 = 0, and the curve passes through point P3 .
The variable masses mi (t) are usually called blending functions and, as noted before, the locations
Pi are known as control points. The blending functions, in the case of Bézier curves, are known as
Bernstein polynomials. We will later look at other curves formed with different blending functions.
Bézier curves of any degree can be defined. Figure 2.5 shows sample curves of degree one through
four. A degree n Bézier curve has n + 1 control points whose blending functions are denoted Bin (t),

Degree 1 Degree 2

Degree 3 Degree 4

Figure 2.5: Bézier curves of various degree.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
20 Bézier Curves over Arbitrary Parameter Intervals

where  
n
Bin (t) = (1 − t)n−i ti , i = 0, 1, ..., n.
i
Recall that  
n n!
= .
i i!(n − i)!
n
is spoken “n – choose – i” and is called a binomial coefficient because it arises in the binomial

i
expansion
n  
X n i n−i
(a + b) =
n
ab .
i=0
i

In the degree three case, n = 3 and B03 = (1 − t)3 , B13 = 3t(1 − t)2 , B23 = 3t2 (1 − t) and B33 = t3 .
Bin (t)is also referred to as the ith Bernstein polynomial of degree n. The equation of a Bézier curve
is thus:
n  
X n
P(t) = (1 − t)n−i ti Pi . (2.2)
i=0
i

2.2 Bézier Curves over Arbitrary Parameter Intervals


Equation 2.2 gives the equation of a Bézier curve which starts at t = 0 and ends at t = 1. It is
useful, especially when fitting together a string of Bézier curves, to allow an arbitrary parameter
interval:
t ∈ [t0 , t1 ]
such that P(t0 ) = P0 and P(t1 ) = Pn . We will denote the Bézier curve defined over an arbitrary
parameter interval by P[t0 ,t1 ] (t). It’s equation is a modification of (2.2):
Pn n  
n
(t1 − t)n−i (t − t0 )i Pi

X n t1 − t n−i t − t0 i
P[t0 ,t1 ] (t) = i=0 i
= ( ) ( ) Pi . (2.3)
(t1 − t0 )n
i=0
i t1 − t0 t1 − t0

If no parameter interval is specified, it is assumed to be [0, 1]. That is,

P(t) = P[0,1] (t).

2.3 The de Casteljau Algorithm


The de Casteljau algorithm describes how to subdivide a Bézier curve P[t0 ,t2 ] into two segments
P[t0 ,t1 ] and P[t1 ,t2 ] whose union is equivalent to P[t0 ,t2 ] . This algorithm was devised in 1959 by Paul
de Casteljau, a French mathematician at the Citroen automobile company. It is an example of a
geometric construction algorithm.
To facilitate our description of the algorithm, we label the control points of a cubic Bézier curve
P[t0 ,t2 ] with P00 , P01 , P02 , and P03 as illustrated in Figure 2.6. The algorithm involves computing the
sequence of points

Pji = (1 − τ )Pj−1
i + τ Pj−1
i+1 ; j = 1, . . . , n; i = 0, . . . , n − j. (2.4)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
The de Casteljau Algorithm 21

P20 P11 P20


P11
P12 2
P10 P10 P0
P12
P21
P02 P03 P03
P01 P21
P01
P30 P30
P00 P00
! = .4 ! = .6

Figure 2.6: Subdividing a cubic Bézier curve.

where τ = tt21 −t
−t0
0
. Then, the control points for P[t0 ,t1 ] (t) are P00 , P10 , P20 , . . . , Pn0 and the control
points for P[t1 ,t2 ] (t) are Pn0 , Pn−1
1 , Pn−2
2 , . . . , P0n . Although our example is for a cubic Bézier curve
(n = 3), the algorithm works for any degree.
A practical application of the de Casteljau algorithm is that it provides a numerically stable means
of computing the coordinates and tangent vector of any point along the curve, since P(t1 ) = Pn0
and the tangent vector is Pn−1 1 − Pn−1
0 .
Figure 2.7 shows that when a Bézier curve is repeatedly subdivided, the collection of control
polygons converge to the curve. Thus, one way of plotting a Bézier curve is to simply subdivide it

1 curve 2 curves

4 curves 8 curves

Figure 2.7: Recursively subdividing a quadratic Bézier curve.

an appropriate number of times and plot the control polygons (although a more efficient way is to
use Horner’s algorithm (see Chapter 3) or forward differencing (see Chapter 4)).
The de Casteljau algorithm works even if τ 6∈ [0, 1], which is equivalent to t1 6∈ [t0 , t2 ]. Fig. 2.8
shows a quadratic Bézier curve “subdivided” at τ = 2. The de Castelau algorithm is numerically
stable as long as the parameter subdivision parameter is within the parameter domain of the curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
22 Degree Elevation

P01

P11
P10
P20

P02
P00
!=2

Figure 2.8: Subdividing a quadratic Bézier curve.

2.4 Degree Elevation


Any degree n Bézier curve can be exactly represented as a Bézier curve of degree n + 1 (and hence,
as a curve of any degree m > n). Given a degree n Bézier curve, the procedure for computing the
control points for the equivalent degree n + 1 Bézier curve is called degree elevation.
We now derive the degree elevation formula, using the identities:

 
n
(1 − t)Bin (t) = (1 − t) (1 − t)n−i ti
i
 
n
= (1 − t)n−i+1 ti
i
n
n+1
  
= i
n+1
 (1 − t)n−i+1 ti
i
i
n
 n!
i!(n−i)!
= i
 n+1
n+1 Bi = (n+1)!
Bin+1
i i!(n+1−i)!
n!i!(n + 1 − i)! n+1 n!i!(n + 1 − i)(n − i)! n+1
= B = Bi
i!(n − i)!(n + 1)! i i!(n − i)!(n + 1)n!
n + 1 − i n+1
= Bi (2.5)
n+1

and
i + 1 n+1
tBin (t) = B (t). (2.6)
n + 1 i+1

Degree elevation is accomplished by simply multiplying the equation of the degree n Bézier curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Degree Elevation 23

by [(1 − t) + t] = 1:

P(t) = [(1 − t) + t]P(t)


n
X
= [(1 − t) + t] Pi Bin (t)
i=0
n
X
= Pi [(1 + t)Bin (t) + tBin (t)]
i=0
n
X n + 1 − i n+1 i + 1 n+1
= Pi [ Bi + B (t)]
i=0
n+1 n + 1 i+1
n n
X n+1−i X i+1
= Pi Bin+1 + Pi Bi+1
n+1
(t)
i=0
n+1 i=0
n + 1
n n+1
X n+1−i X i
= Pi Bin+1 + Pi−1 Bin+1 (t)
i=0
n+1 i=1
n + 1
n+1 n+1
X n+1−i X i
= Pi Bin+1 + Pi−1 Bin+1 (t)
i=0
n+1 i=0
n + 1
n+1
X (n + 1 − i)Pi + iPi−1 n+1
= [ ]Bi (t)
i=0
n+1
n+1
X
= P∗i Bin+1 (t) (2.7)
i=0

where
i
P∗i = αi Pi−1 + (1 − αi )Pi , αi = . (2.8)
n+1

P1 old P2* P2
Degree 2 Degree 3 Degree 4
P1* new P3*

1/2

1/4

P3 P4*
P0* P0 Degree 5 Degree 6 Degree 7

(a) Degree Elevation of a Cubic Bézier Curve. (b) Repeated degree elevation.

Figure 2.9: Degree Elevation of a Bézier Curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
24 The Convex Hull Property of Bézier Curves

For the case n = 3, the new control points P∗i are:

P∗0 = P0

1 3
P∗1 = P0 + P1
4 4
2 2
P∗2 = P1 + P2
4 4
3 1
P∗3 = P2 + P3
4 4
P∗4 = P3
Figure 2.9.a illustrates.
If degree elevation is applied repeatedly, as shown in Figure 2.9.b, the control polygon converges
to the curve itself.

2.5 The Convex Hull Property of Bézier Curves


An important property of Bézier curves is that they always lie within the convex hull of their control
points. The convex hull can be envisioned by pounding an imaginary nail into each control point,
stretching an imaginary rubber band so that it surrounds the group of nails, and then collapsing that
rubber band around the nails. The polygon created by that imaginary rubber band is the convex
hull. Figure 2.10 illustrates.
The fact that Bézier curves obey the convex hull property is assured by the center-of-mass
definition of Bézier curves in Section 2.1. Since all of the control points lie on one side of an edge
of the convex hull, it is impossible for the center of mass of those control points to lie on the other
side of the line,

P1 P3 P2 P1

P0 P2 P0 P3

P1 P2 P3

P0 P3
P0 P1 P2

Figure 2.10: Convex Hull Property

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Distance between Two Bézier Curves 25

2.6 Distance between Two Bézier Curves


The problem often arises of determining how closely a given Bézier curve is approximated by a
second Bézier curve. For example, if a given cubic curve can be adequately represented by a degree
elevated quadratic curve, it might be advantageous to replace the cubic curve with the quadratic.
Given two Bézier curves
Xn Xn
P(t) = Pi Bin (t); Q(t) = Qi Bin (t)
i=0 i=0

the vector P(t) − Q(t) between points of equal parameter value on the two curves can itself be
expressed as a Bézier curve
n
X
D(t) = P(t) − Q(t) = (Pi − Qi )Bin (t)
i=0

whose control points are Di = Pi − Qi . The vector from the origin to the point D(t) is P(t) − Q(t).
The convex hull property guarantees that the distance between the two curves is bounded by the
largest distance from the origin to any of the control points Di .

Q1
Q2
P1 P2
P3-Q3

t=1/2

P0-Q0 P2-Q2

P3 P1-Q1
Q0
P0 Q3

Figure 2.11: Difference curve.

This error bound is attractive because it is very easy to compute. However, it is not always a
very tight bound because it is dependent on parametrization.
A more precise statement of the distance between two curves is the Hausdorff distance. Given
two curves P[s0 ,s1 ] (s) and Q[t0 ,t1 ] (t). The Hausdorff distance d(P, Q) is defined
 
d(P, Q) = max min |P(s) − Q(t)| (2.9)
s∈[s0 ,s1 ] t∈[t0 ,t1 ]

where |P(s) − Q(t)| is the Euclidean distance between a point P(s) and the point Q(t). In practice,
it is much more expensive to compute the Hausdorff distance than to compute a bound using the
difference curve in Figure 2.11.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
26 Derivatives

2.7 Derivatives
The parametric derivatives of a Bézier curve can be determined geometrically from its control points.
For a polynomial Bézier curve P[t0 ,t1 ] (t) of degree n with control points Pi , the first parametric
derivative can be expressed as a polynomial Bézier curve of degree n − 1 with control points Di
where
n
Di = (Pi+1 − Pi ).
t1 − t0
For example, the cubic Bézier curve in Fig. 2.12 has a first derivative curve as shown. Of course,

D0

3(P1-P0)

P1 (0,0) P’(t)
P0 P(t) 3(P3-P2)
P2
P3 3(P2-P1)
D2

D1

Figure 2.12: Hodograph.

the first derivative of a parametric curve provides us with a tangent vector. This is illustrated in
Fig. 2.12 for the point t = .3. In this example, t0 = 0 and t1 = 1.
The first derivative curve is known as a hodograph. We can compute the second derivative of a
Bézier curve by taking the hodograph of the hodograph (or, the second hodograph), etc.
It is interesting to note that if the hodograph passes through the origin, there is a cusp corre-
sponding to that point on the original curve!
Note that the hodograph we have just described relates only to polynomial Bézier curves, not
to rational Bézier curves or any other curve that we will study. The derivative of any other curve
must be computed by differentiation. For a rational Bézier curve, that differentiation will involve
the quotient rule. Consequently, the derivative of a degree n rational Bézier curve can be expressed
as a rational Bézier curve of degree 2n. As it turns out, the equations for those control points are
rather messy.

2.8 Three Dimensional Bézier Curves


If Bézier control points are defined in three dimensional space, the resulting Bézier curve is three
dimensional. Such a curve is sometimes called a space curve, and a two dimensional curve is called
a planar curve. Our discussion of the de Casteljau algorithm, degree elevation, and hodographs
extend to 3D without modification.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Rational Bézier Curves 27

Since a degree two Bézier curve is defined using three control points, every degree two curve is
planar, even if the control points are in a three dimensional coordinate system.

2.9 Rational Bézier Curves


A rational Bézier curve is one for which each control point Pi is assigned a scalar weight. The
equation of a rational Bézier curve is
Pn
i=0 wi Bi (t)Pi
n
n .
i=0 wi Bi (t)
n
P

The effect of changing a control point weight is illustrated in Fig. 2.13. This type of curve is known

P2

w2=5 w2=10
P1
w2=2

w2=1

w2=.5

w2=0

P3

P0

Figure 2.13: Rational Bézier curve.

as a rational Bézier curve, because the blending functions are rational polynomials, or the ratio of
two polynomials. Note that if all weights are 1 (or if all weights are simply the same), a rational
Bézier curve reduces to a polynomial Bézier curve.
Rational Bézier curves have several advantages over polynomial Bézier curves. Clearly, rational
Bézier curves provide more control over the shape of a curve than does a polynomial Bézier curve.
In addition, a perspective drawing of a 3D Bézier curve (polynomial or rational) is a rational Bézier
curve, not a polynomial Bézier curve. Also, rational Bézier curves are needed to exactly express
all conic sections. A degree two polynomial Bézier curve can only represent a parabola. Exact
representation of circles requires rational degree two Bézier curves.
A rational Bézier curve can be interpreted as the perspective projection of a 3-D polynomial
curve. Fig. 2.14 shows two curves: a 3-D curve and a 2-D curve. The 2-D curve lies on the plane
z = 1 and it is defined as the projection of the 3-D curve onto the plane z = 1. One way to consider

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
28 Rational Bézier Curves

(x1,y1,1)w1

(x2,y2,1)w2
(x0,y0,1)w0
z

(x3,y3,1)w3
(x1,y1,1)
(x2,y2,1)
z=1 (x0,y0,1) (x3,y3,1)

y
x
z

xi
wi
z=1
1
x
xiwi

Figure 2.14: Rational curve as the projection of a 3-D curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Rational Bézier Curves 29

this is to imagine a funny looking cone whose vertex is at the origin and which contains the 3-D
curve. In other words, this cone is the collection of all lines which contain the origin and a point on
the curve. Then, the 2-D rational Bézier curve is the intersection of the cone with the plane z = 1.
What we see here can be viewed as the geometric interpretation of homogeneous coordinates dis-
cussed in Section 7.1.1. The 3D Bézier control points wi (xi , yi , 1) = (xi wi , yi wi , wi ) can be thought
of as homogeneous coordinates (X, Y, Z) that correspond to 2D Cartesian coordinates ( X Z , Z ). If the
Y

2-D rational Bézier curve has control points (xi , yi ) with corresponding weights wi , then the homo-
geneous (X, Y, Z) coordinates of the 3-D control points are wi (xi , yi , 1) = (xi wi , yi wi , wi ). Denote
points on the 3-D curve using upper case variables (X(t), Y (t), Z(t)) and on the 2-D curve using
lower case variables (x(t), y(t)). Then, any point on the 2-D rational Bézier curve can be computed
by computing the corresponding point on the 3-D curve, (X(t), Y (t), Z(t)), and projecting it to the
plane z = 1 by setting
X(t) Y (t)
x(t) = , y(t) = .
Z(t) Z(t)

2.9.1 De Casteljau Algorithm and Degree Elevation on Rational Bézier


Curves
The de Casteljau algorithm and degree elevation algorithms for polynomial Bézier curves extend eas-
ily to rational Bézier curves as follows. First, convert the rational Bézier curve into its corresponding
polynomial 3D Bézier curve as discussed in Section 2.9. Next, perform the de Casteljau algorithm
or degree elevation on the 3D polynomial Bézier curve. Finally, map the resulting 3D Bézier curve
back to 2D. The Z coordinates of the control points end up as the weights of the control points for
the 2D rational Bézier curve.
This procedure does not work for hodographs, since the derivative of a rational Bézier curve
requires the use of the quotient rule for differentiation. However, Section 2.9.2 describes how to
compute the first derivative at the endpoint of a rational Bézier curve and Section 2.9.3 describes
how to compute the curvature at the endpoint of a rational Bézier curve. Used in conjunction with
the de Casteljau algorithm, this enable us to compute the first derivative or curvature at any point
on a rational Bézier curve.

2.9.2 First Derivative at the Endpoint of a Rational Bézier Curve


The derivative equation for a rational Bézier involves the quotient rule for derivatives — it does not
work to simply compute the tangent vector and curvature for the three dimensional non-rational
Bézier curve and then project that value to the (x, y) plane. For a degree n rational Bézier curve
P[0,1] (t),
xn (t)
x(t) = =
d(t)

w0 x0 n0 (1 − t)n + w1 x1 n1 (1 − t)n−1 t + w2 x2 n2 (1 − t)n−2 t2 + . . .


  
;
w0 n0 (1 − t)n + w1 n1 (1 − t)n−1 t + w2 n2 (1 − t)n−2 t2 + . . .
  

yn (t)
y(t) = =
d(t)

w0 y0 n0 (1 − t)n + w1 y1 n1 (1 − t)n−1 t + w2 y2 n2 (1 − t)n−2 t2 + . . .


  

w0 n0 (1 − t)n + w1 n1 (1 − t)n−1 t + w2 n2 (1 − t)n−2 t2 + . . .


  

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
30 Rational Bézier Curves

the equation for the first derivative vector at t = 0 must be found by evaluating the following
equations:
˙
d(0)ẋn (0) − d(0)x n (0)
˙
d(0)ẏn (0) − d(0)y n (0)
ẋ(0) = ; ẏ(0) =
d (0)
2 d (0)
2

from which
w1
P0 (0) = n(P1 − P0 ). (2.10)
w0
For a rational curve P[t0 ,t1 ] (t), the first derivative at t = t0 is:
w1 n
P0 (0) = (P1 − P0 ). (2.11)
w0 t1 − t0

The second derivative of a rational Bézier curve at its endpoint is

n(n − 1) w2 2n w1 nw1 − w0
P00 (0) = (P2 − P0 ) − (P1 − P0 ) (2.12)
(t1 − t0 )2 w0 (t1 − t0 )2 w0 w0

2.9.3 Curvature at an Endpoint of a Rational Bézier Curve


The curvature (denoted by κ) of a curve is a measure of how sharply it curves. The curvature of a
circle of radius ρ is defined to be κ = 1/ρ. A straight line does not curve at all, and its curvature is
zero. For other curves, the curvature is generally different at each point on the curve. The meaning
of curvature in this general case is illustrated by Figure 2.15 which shows a Bézier curve and the
osculating circle with respect to a point on the curve. The word “osculate” means to kiss, and the
osculating circle is the circle that “best fits” the curve at a particular point in the following sense.
An arbitrary line that passes through a point on a curve intersects the curve with multiplicity one;
the tangent line at that point intersects the curve with multiplicity two. An osculating circle is a
circle of radius ρ that intersects the curve with multiplicity at least three, and the curvature κ is
defined to be κ = 1/ρ. (See Section 7.3.1 for a description of intersection multiplicity.) ρ is called
the radius of curvature for the curve at that point.

Tangent line

ρ
C

Figure 2.15: Osculating Circle.

In Figure 2.15, the center of the circle, C, is located along the normal line a distance ρ from the
point of contact.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Rational Bézier Curves 31

The equation for the curvature of a parametric curve is

|ẋÿ − ẏẍ|
κ= 3
(ẋ2 + ẏ 2 ) 2

where the dots denote differentiation with respect to the curve parameter. If this equation is applied
to an endpoint of a rational Bézier curve, a beautifully simple and geometrically meaningful equation
results:
w0 w2 n − 1 h
κ(t0 ) = (2.13)
w12 n a2
where n is the degree of the curve and a and h are as shown in Fig. 2.16 (a is the length of the first
leg of the control polygon, and h is the perpendicular distance from P2 to the first leg of the control
polygon). Curvature is independent of [t0 , t1 ].

P2

P0
h

a P1

Figure 2.16: Endpoint curvature.

While is is mathematically possible to write down an equation for the first derivative vector and
for the curvature of a rational Bézier curve as a function of t, such equations would be extremely
complicated. The best way to find the curvature or first derivative vector at an arbitrary point
along a rational Bézier curve is to first perform the de Casteljau algorithm (Section 2.3) to make
the desired point an endpoint of the curve, and then apply (2.11) or (2.13).

Example A rational quadratic Bézier curve has control points and weights:

P0 = (0, 0), w0 = 1; P1 = (4, 3), w1 = 2; P2 = (0, 5), w2 = 4.

What is the curvature at t = 0?


Solution
The distance equation for the line P0 − −P1 is 53 x − 45 y, so plugging the Cartesian coordinates of
P2 into this
√ distance equation give h = 4. The value of a is found as the distance from P0 to P1 ,
which is 42 + 32 = 5. So, the curvature is

w0 w2 n − 1 h 1·41 4 2
κ(0) = = 2 =
w12 n a 2 2 25 2 25

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
32 Continuity

2.10 Continuity
Two curve segments P[t0 ,t1 ] and Q[t1 ,t2 ] are said to be C k continuous (or, to have k th order parametric
continuity) if
P(t1 ) = Q(t1 ), P0 (t1 ) = Q0 (t1 ), . . . , P(k) (t1 ) = Q(k) (t1 ). (2.14)
Thus, C 0 means simply that the two adjacent curves share a common endpoint. C 1 means that the
two curves not only share the same endpoint, but also that they have the same tangent vector at
their shared endpoint, in magnitude as well as in direction. C 2 means that two curves are C 1 and
in addition that they have the same second order parametric derivatives at their shared endpoint,
both in magnitude and in direction.
In Fig. 2.17, the two curves P[t0 ,t1 ] (t) and Q[t1 ,t2 ] (t) are at least C 0 because p3 ≡ q0 . Furthermore,

q3
p0

q2
p1

p2 p3 q0 q1

Figure 2.17: C 2 Bézier curves.

they are C 1 if
3 3
(p3 − p2 ) = (q1 − q0 ).
t1 − t0 t2 − t1
They are C 2 if they are C 1 and
6 6
(p3 − 2p2 + p1 ) = (q2 − 2q1 + q0 ).
(t1 − t0 )2 (t2 − t1 )2

A second method for describing the continuity of two curves, that is independent of their
parametrization, is called geometric continuity and is denoted Gk . The conditions for geometric
continuity (also known as visual continuity) are less strict than for parametric continuity. For G0
continuity, we simply require that the two curves have a common endpoint, but we do not require
that they have the same parameter value at that common point. For G1 , we require that line seg-
ments p2 − p3 and q0 − q1 are collinear, but they need not be of equal length. This means that
they have a common tangent line, though the magnitude of the tangent vector may be different. G2
(second order geometric continuity) means that the two neighboring curves have the same tangent
line and also the same center of curvature at their common boundary. A general definition of Gn is
that two curves that are Gn can be reparametrized (see Section 2.12) to make them be C n . Two
curves which are C n are also Gn , as long as (2.15) holds.

P(t1 ) = Q(t1 ), P0 (t1 ) = Q0 (t1 ) 6= 0, . . . , P(k) (t1 ) = Q(k) (t1 ) 6= 0. (2.15)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Circular Arcs 33

Second order continuity (C 2 or G2 ) is often desirable for both physical and aesthetic reasons.
One reason that cubic NURBS curves and surfaces are an industry standard in CAD is that they
are C 2 . Two surfaces that are G1 but not G2 do not have smooth reflection lines. Thus, a car body
made up of G1 surfaces will not look smooth in a show room. Railroad cars will jerk where G1
curves meet.

2.11 Circular Arcs


Circular arcs can be exactly represented using rational Bézier curves. Figure 2.18 shows a circular

Q0; w0= 1
P0; w0= 1
e
P1; w1= cos!/2 Q1; w1= (1 + 2cos!/2)/3
r r
! ! Q2; w2= (1 + 2cos!/2)/3
d

e
P2; w2= 1 Q3; w3= 1

Figure 2.18: Circular arcs.

arc as both a degree two and a degree three rational Bézier curve. Of course, the control polygons
are tangent to the circle. The degree three case is a simple degree elevation of the degree two case.
The length e is given by
2 sin θ2
e= r.
1 + 2 cos θ2
The degree two case has trouble when θ approaches 180◦ since P1 moves to infinity, although this
can be remedied by just using homogeneous coordinates. The degree three case has the advantage
that it can represent a larger arc, but even here the length e goes to infinity as θ approaches 240◦ .
For large arcs, a simple solution is to just cut the arc in half and use two cubic Bézier curves. A
complete circle can be represented as a degree five Bézier curve as shown in Figure 2.19. Here, the
weights are w0 = w5 = 1 and w1 = w2 = w3 = w4 = 51 .

2.12 Reparametrization of Bézier Curves


Reparametrization of a curve means to change how a curve is parametrized, i.e., to change which
parameter value is assigned to each point on the curve. Reparametrization can be performed by a
parameter substitution. Given a parametric curve P(t), if we make the substitution t = f (s), we
end up with a curve Q(s) which is geometrically identical to P(t). For example, let
P(t) = (t2 + t − 1, 2t2 − t + 3), t = 2s + 1
yields
Q(s) = ((2s + 1)2 + (2s + 1) − 1, 2(2s + 1)2 − (2s + 1) + 3) = (4s2 + 6s + 1, 8s2 + 6s + 4).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
34 Reparametrization of Bézier Curves

p3 = (-2,4) p2 = (2,4)

p4 = (-4,0) p5 = (0,0) p0 = (0,0) p1 = (4,0)

Figure 2.19: Circle as Degree 5 Rational Bézier Curve.

The curves P(t) and Q(s) consist of the same points (if the domains are infinite) but the correspon-
dence between parameter values and points on the curve are different.
A simple (and obvious) way to reparametrize a Bézier curve P[t0 ,t1 ] (t) is to simply change the
values of t0 and t1 without changing the control points. Thus, two curves P[t0 ,t1 ] (t) and Q[s0 ,s1 ] (s)
that have the same degree, control point positions, and weights, but for which t0 6= s0 and/or t1 6= s1
are reparametrizations of each other. The reparametrization function is
t0 s1 − s0 t1 t1 − t0 s0 t1 − t0 s1 s1 − s0
t= + s, or s = + t.
s1 − s0 s1 − s0 t1 − t0 t1 − t0
Example
Bézier curves P[0,1] (t) and Q[5,9] (s) have the same degree, control point positions, and weights. The
curves look the same, but have different parametrizations. For example,

P(0) = Q(5), P(1) = Q(9), P(.5) = Q(7).

In general,
5 1
P(t) ≡ Q(5 + 4t) and Q(s) ≡ P(− + s).
4 4
A rational parametric curve can be reparametrized with the substitution t = f (u)/g(u). In
this case, it is possible to perform a rational-linear reparametrization which does not change the
endpoints of the curve segment. If we let
a(1 − u) + bu
t =
c(1 − u) + du
and want u = 0 when t = 0 and u = 1 when t = 1, then a = 0 and b = d. Since we can scale then
numerator and denominator without affecting the reparametrization, set c = 1 and we are left with
bu
t =
(1 − u) + bu
A rational Bézier curve
n
w0 P0 (1 − t)n + n
w1 P1 (1 − t)n−1 t + ... + nn wn Pn tn
  
X(t) = 0 1

0 w0 (1 − t)
n +
1 w1 (1 − t)
n n n−1 t + ... + n w tn
  
n n

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Advantages of Rational Bézier Curves 35

can be raparametrized without changing its endpoints by making the substitutions

bu (1 − u)
t = , (1 − t) = .
(1 − u) + bu (1 − u) + bu

After multiplying numerator and denominator by ((1 − u) + bu)n , we obtain

0 (b w0 )P 0 (1 − u) + n1 (b1 w1 )P1 (1 − u)n−1 u + ... + nn (bn wn )Pn un


n
 0 n
 
X(u) =
0 b w0 (1 − u)
n 0 n + n b1 w (1 − u)n−1 u + ... + n bn w un
  
1 1 n n

In other words, if we scale the weights wi by bi , the curve will not be changed!

Negative Weights
Normally, negative weights are discouraged for Bézier curves because they can cause a violation
of the convex hull property. However, an interesting situation arises if we choose b = −1 for the
rational reparametrization: the signs of the weights alternate, and the curve for u ∈ [0, 1] is the
curve t ∈ (∞, 0] ∪ [1, ∞). If the original curve is a quarter circle, the reparametrized curve will be
the rest of the circle, as shown in Figure 2.20.

P2= (1,0), w=2 P1= (1,1), w=1 P1= (1,1), w=-1


P2= (1,0), w=2

P0= (1,0), w=1

P0= (1,0), w=1

(a) Quarter circle. (b) After reparametrization with b = −1.

Figure 2.20: Circle with negative weight.

2.13 Advantages of Rational Bézier Curves


As we have seen, rational Bézier curves have several advantages over polynomial Bézier curves. We
here emphasize them.
1. Rational Bézier curves can represent conic sections exactly.
2. If you perform a perspective projection of a Bézier curve (either a polynomial or rational), the
result is a rational Bézier curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
36 Explicit Bézier Curves

3. Rational Bézier curves permit some additional shape control: by changing the weights, you
change the shape of the curve.

4. It is possible to reparametrize the curve by simply changing the weights in a specific manner.

2.14 Explicit Bézier Curves


An explicit Bézier curve P[t0 ,t1 ] (t) is one for which x ≡ t. For a polynomial Bézier curve, this
happens when the x-coordinates of the control points are evenly spaced between t0 and t1 . That is,
Pi = ( t0 (n−i)+t
n
1i
, yi ), i = 0, . . . , n. Such a Bézier curve takes on the form of a function

x = t
y = f (t)

or simply
y = f (x).
An explicit Bézier curve is sometimes called a non-parametric Bézier curve. It is just a polynomial
function expressed in the Bernstein polynomial basis. Figure 2.21 shows a degree five explicit Bézier
curve over the domain [t0 , t1 ] = [0, 1].

P1
P4
P5
.2
0 .4 .6 .8 1

P2
P0
P3

Figure 2.21: Explicit Bézier curve.

It is also possible to create an explicit rational Bézier curve. However, the representation of a
degree-n rational function Pn
wi yi Bin (t)
x = t; y = Pi=0 n
i=0 wi Bi (t)
n

as an explicit Bézier curve is degree n + 1 because we must have


Pn
wi Bin (t)
x = t = t Pni=0
i=0 wi Bi (t)
n

which is degree n + 1. Since x(t) is degree n + 1, we must likewise degree elevate y(t).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Integrating Bernstein polynomials 37

2.15 Integrating Bernstein polynomials


Recall that the hodograph (first derivative) of a Bézier curve is easily found by simply differencing
adjacent control points (Section 2.7). It is equally simple to compute the integral of a Bernstein
polynomial. Since the integral of a polynomial in Bernstein form
n
X
p(t) = pi Bin (t) (2.16)
i=0

is that polynomial whose derivative is p(t). If the desired integral is a degree n + 1 polynomial in
Bernstein form
n+1
X
q(t) = qi Bin+1 (t), (2.17)
i=0

we have
pi = (n + 1)(qi+1 − qi ). (2.18)
Hence, q0 = 0 and
Pi−1
j=0 pj
qi = , i = 1, n + 1. (2.19)
n+1
Note that if p(t) is expressed as an explicit Bézier curve, q(t) can be interpreted as the area under
p(t) between the lines x = 0 and x = t. Thus, the entire area under an explicit Bézier curve can be
computed as simply the average of the control points! This is so because
Pn
j=0 pj
q(1) = qn+1 = . (2.20)
n+1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
38 Integrating Bernstein polynomials

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 3

Polynomial Evaluation and Basis


Conversion

3.1 Horner’s Algorithm in Power Basis


Horner’s algorithm can evaluate a power basis polynomial
n
X
y(t) = pi ti
i=0

using n multiplies and adds. The trick is to rewrite the polynomial in nested form:
y(t) = (· · · ((pn t + pn−1 )t + pn−2 )t + · · · + p1 )t + p0
This can be written
hn = pn
hi−1 = t · hi + pi−1 , i = n, . . . , 1
y(t) = h0
or, as a C funtion,
float p_horner(float *p,int n, float t)
{
float h;
int i;

h = p[n];
for(i=n-1; i>=0; i--)
h = t*h + p[i];
return h;
}
This is the fastest algorithm for evaluating a power basis polynomial at a single point.
For evaluating a polynomial at several evenly spaced intervals (f (0), f (a), f (2a), f (3a), etc.)
forward differencing works faster (see Chapter 4) but suffers from numerical instability.

39
40 Horner’s Algorithm in Bernstein Basis

3.2 Horner’s Algorithm in Bernstein Basis


We have seen that one way to evaluate a Bézier curve (that is, to compute the Cartesian coordinates
of a point on a Bézier curve) is to use the de Casteljau algorithm. Another option is to convert it to
power basis (see Section 3.3) and then use Horner’s algorithm in Section 3.1. Alternatively, Horner’s
algorithm can be modified to work directly on Bernstein polynomials. We can use the recurrence
relation for binomial coefficients
n−i+1
   
n n
=
i i i−1
to derive a nested multiplication which does not involve the binomial coefficients directly:
float b_horner(float *b, int n, float t)
{
float u, bc, tn, tmp;
int i;

u = 1.0 - t;
bc = 1;
tn = 1;
tmp = b[0]*u;
for(i=1; i<n; i++){
tn = tn*t;
bc = bc*(n-i+1)/i;
tmp = (tmp + tn*bc*b[i])*u;
}
return (tmp + tn*t*b[n]);
}

3.3 Basis Conversion


A fundamental problem in CAGD is that of polynomial basis conversion. We here consider the
common case of conversion between power and Bernstein bases. For example, given a Bézier curve
of any degree, we want to find the equivalent power basis equation and vice versa.
Denote a polynomial in Bernstein form
n  
X n
B(t) = bi (1 − t)n−i ti
i=0
i

and a polynomial in power form


n
X
P (t) = pi ti .
i=0
The problem we consider is, given the bi of a polynomial in Bernstein basis, find the pi for the
equivalent power basis polynomial (Bernstein to power basis conversion) or given the pi find the bi
(power to Bernstein conversion).
An elegant solution to this problem can be obtained by performing a Taylor’s series expansion.
The Taylor’s expansion of B(t) is:
B 00 (0)t2 B (i) (0)ti
B(t) ≡ B(0) + B 0 (0)t + + ... + + ....
2 i

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Basis Conversion 41

A power basis polynomial is equivalent to a Bernstein basis polynomial (P (t) ≡ B(t)) if and only if
P (i) (0)ti B (i) (0)ti
≡ , i = 0, . . . , n.
i! i!
But, for power basis,
P (i) (0)
= pi
i!
so
B (i) (0)
pi =
, i = 0, . . . , n. (3.1)
i!
The terms B (i) (0) can be found by setting up a difference table. Remember from our study of
hodographs that the coefficients of the derivative of a polynomial in Bernstein form (for example,
the x or y component of a Bézier curve) are:
n(b1 − b0 ), n(b2 − b1 ), . . . , n(bn − bn−1 ).
The coefficients of the second derivative are:
n(n − 1)(b2 − 2b1 + b0 ), n(n − 1)(b3 − 2b2 + b1 ), . . . , n(n − 1)(bn − 2bn−1 + bn−2 ).
Pn
Since B(0) = i=0 bi ni (1 − 0)n−i 0i = b0 , we have


B 0 (0) = n(b1 − b0 ), B 00 (0) = n(n − 1)(b2 − 2b1 + b0 )


i  
(i−j+1) i
X
B (0) = n(n − 1) · · · (n − i + 1)
(i)
(−1) bj .
j=0
j
This can be written more neatly if we define the recurrence
bji = bj−1 j−1
i+1 − bi

with b0i ≡ bi . Then


n!
B (i) (0) = n(n − 1) · · · (n − i + 1)bi0 = bi .
(n − i)! 0
From equation 3.1,  
n! n i
pi = bi = b .
(n − i)!i! 0 i 0
Thus, the problem reduces to one of finding the values bi0 . This is easily done using a difference
table:
b00 = b0 = p0 b01 = b1 ... b0n = bn
b10 = b01 − b00 = p1 / n1  b11 = b02 − b01 b0n = b0n − b0n−1

...
b20 = b11 − b10 = p2 / n2 b21 = b12 − b11 ... b2n = b1n − b1n−1
... ... ... ...
bn−1 = bn−2 − bn−2 = pn−1 / n
bn−1 = bn−2 − bn−2

0 1 0 n−1 1 2 1
b0 = b1 − bn−1
n n−1
0 = pn

Thus, to perform Bernstein to power basis conversion, load theBernstein coefficients into the top row
and compute the difference table. Scale the left column by ni , and you have the power coefficients.
To perform power to Bernstein conversion, divide the power coefficients by ni , load them into


the left column, compute the difference table backwards, and read the Bernstein coefficients off the
top row.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
42 Basis Conversion

3.3.1 Example
Convert to power basis the degree 4 Bernstein form polynomial with coefficients (1, 3, 4, 6, 8). This
is done by setting up the difference table
1 3 4 6 8
2 1 2 2
-1 1 0
2 -1
-3
so the power coefficient are taken from the left column, times the binomial coefficients:

4
 
p0 = 1 =1
0

4
 
p1 = 2 =8
1
4
 
p2 = −1 = −6
2
4
 
p3 = 2 =8
3
4
 
p4 = −3 = −3
4

3.3.2 Closed Form Expression


The conversion from Bernstein to power basis can be written concisely as follows:
i   
X n i
pi = bk (−1)i−k .
i k
k=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 4

Forward Differencing

Horner’s algorithm is the fastest method for evaluating a polynomial at a single point. For a degree
n polynomial, it requires n multiplies and n adds.
If a polynomial is to be evaluated at several evenly spaced values t, t + δ, t + 2δ, . . . , t + kδ, the
fastest method is to use forward differences.
Consider a degree 1 polynomial
f (t) = a0 + a1 t.
The difference between two adjacent function values is

∆1 (t) = f (t + δ) − f (t) = [a0 + a1 (t + δ)] − [a0 + a1 t] = a1 δ.

Thus, f (t) can be evaluated at several evenly spaced points using the algorithm:

∆1 = a1 δ
t0 = 0
f (0) = a0
for i = 1 to k do
ti = ti−1 + δ
f (ti ) = f (ti−1 ) + ∆1
endfor

Thus, each successive evaluation requires only one add, as opposed to one add and one multiply
for Horner’s algorithm.
This idea extends to polynomials of any degree. For the quadratic case,

f (t) = a0 + a1 t + a2 t2 .

The difference between two adjacent function values is

∆1 (t) = f (t + δ) − f (t) = [a0 + a1 (t + δ) + a2 (t + δ)2 ] − [a0 + a1 t + a2 t2 ]

∆1 (t) = a1 δ + a2 δ 2 + 2a2 tδ.


We can now write

43
44

t0 = 0
f (0) = a0
for i = 1 to k do
ti = ti−1 + δ
∆1 (ti ) = a1 δ + a2 δ 2 + 2a2 ti−1 δ
f (ti ) = f (ti−1 ) + ∆1 (ti−1 )
endfor

In this case, ∆(t) is a linear polynomial, so we can evaluate it as above, by defining

∆2 (t) = ∆1 (t + δ) − ∆1 (t) = 2a2 δ 2

and our algorithm now becomes

t0 = 0
f (0) = a0
∆1 = a1 δ + a2 δ 2
∆2 = 2a2 δ 2
for i = 1 to k do
ti = ti−1 + δ
f (ti ) = f (ti−1 ) + ∆1
∆1 = ∆1 + ∆2
endfor

It should be clear that for a degree n polynomial, each successive evaluation requires n adds and no
multiplies! For a cubic polynomial

f (t) = a0 + a1 t + a2 t2 + a3 t3 ,

the forward difference algorithm becomes

t0 = 0
f (0) = a0
∆1 = a1 δ + a2 δ 2 + a3 δ 3
∆2 = 2a2 δ 2 + 6a3 δ 3
∆3 = 6a3 δ 3
for i = 1 to k do
ti = ti−1 + δ
f (ti ) = f (ti−1 ) + ∆1
∆1 = ∆1 + ∆2
∆2 = ∆2 + ∆3
endfor

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
45

Several questions remain. First, what are the initial values for the ∆i if we want to start at
some value other than t = 0. Second, what is a general equation for the ∆i for a general degree n
polynomial f (t). Also, what if our polynomial is not in power basis.
These questions can be answered almost trivially by observing the following. Since ti+1 = ti + δ,
we have
∆1 (ti ) = f (ti+1 ) − f (t);
∆j (ti ) = ∆j−1 (ti+1 ) − ∆j−1 (ti ), j = 2, . . . , n;
∆n (ti ) = ∆n (ti+1 ) = ∆n (ti+k ) = a constant
∆n+1 = 0
Thus, our initial values for ∆j (ti ) can be found by simply computing f (ti ), f (ti+1 ), . . . , f (ti+n )
and from them computing the initial differences. This lends itself nicely to a table. Here is the table
for a degree four case:

f (ti ) f (ti+1 ) f (ti+2 ) f (ti+3 ) f (ti+4 )


∆1 (ti ) ∆1 (ti+1 ) ∆1 (ti+2 ) ∆1 (ti+3 )
∆2 (ti ) ∆2 (ti+1 ) ∆2 (ti+2 )
∆3 (ti ) ∆3 (ti+1 )
∆4 (ti )
0 0 0 0 0

To compute f (ti+5 ), we simply note that every number R in this table, along with its right hand
neighbor Rright and the number directly beneath it Rdown obey the rule

Rright = R + Rdown .

Thus, we can simply fill in the values

∆4 (ti+1 ) = ∆4 (ti ) + 0

∆3 (ti+2 ) = ∆3 (ti+1 ) + ∆4 (ti+1 )


∆2 (ti+3 ) = ∆2 (ti+2 ) + ∆3 (ti+2 )
∆1 (ti+4 ) = ∆1 (ti+3 ) + ∆2 (ti+3 )
f (ti+5 ) = f (ti+4 ) + ∆1 (ti+4 )
Note that this technique is independent of the basis in which f (t) is defined. Thus, even if it
is defined in Bernstein basis, all we need to do is to evaluate it n + 1 times to initiate the forward
differencing.
For example, consider the degree 4 polynomial for which f (ti ) = 1, f (ti+1 ) = 3, f (ti+2 ) = 2,
f (ti+3 ) = 5, f (ti+4 ) = 4. We can compute f (ti+5 ) = −24, f (ti+6 ) = −117, and f (ti+7 ) = −328
from the following difference table:

t: ti ti+1 ti+2 ti+3 ti+4 ti+5 ti+6 ti+7


f (t) : 1 3 2 5 4 −24 −117 −328
∆1 (t) : 2 −1 3 −1 −28 −93 −211
∆2 (t) : −3 4 −4 −27 −65 −118
∆3 (t) : 7 −8 −23 −38 −53
∆4 (t) : −15 −15 −15 −15 −15
∆5 (t) : 0 0 0 0 0 0 0 0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
46 Choosing δ

Example
For a certain cubic polynomial f (t), we have:

f (1) = 1; f (2) = 2; f (3) = 4; f (5) = 15.

Solve for f (4) using forward differencing.


Solution

t: 1 2 3 4 5
f (t) : 1 2 4 x 15
∆1 (t) : 1 2 x−4 15 − x
∆2 (t) : 1 x−6 19 − 2x
∆3 (t) : x−7 25 − 3x
∆4 (t) : 32 − 4x
For a cubic polynomial, ∆4 (t) = 0, so 32 − 4x = 0 and x = 8.

4.1 Choosing δ
This raises the important question of how to select an appropriate value for δ when using forward
differencing to plot a curve. One way to determine δ is so that distance from the the curve to its
polygonal approximation lies within a tolerance. A discussion of how to chose δ that will satisfy
such a requirement is found in Section 10.6.
A second criterion that might be used to choose δ arises in the problem of rasterizing a curve.
This means to “turn on” a contiguous series of pixels that the curve passes through, without any
gaps. If the control points of the degree n Bézier curve are Pi = (xi , yi ) in pixel coordinates, then
let
d = max{xi − xi−1 , yi − yi−1 } i = 1, . . . , n
If you now evaluate the curve at n ∗ d + 1 evenly spaced values of t and paint each resulting pixel,
there will be no gaps in the drawing of the curve. Another way to say this, compute
1
δ= .
n∗d
Then, compute the points P(i ∗ δ), i = 0 . . . , n ∗ d. Note that n ∗ d is an upper bound on the
magnitude of the x or y component of the first derivative of the curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 5

Properties of Blending Functions

We have just studied how the Bernstein polynomials serve very nicely as blending functions. We
have noted that a degree n Bézier curve always begins at P0 and ends at Pn . Also, the curve is
always tangent to the control polygon at P0 and Pn .
Other popular blending functions exist for defining curves. In fact, you can easily make up your
own set of blending functions. And by following a few simple rules, you can actually create a new
type of free-form curve which has desirable properties.
Consider a set of control points Pi , i = 0, ..., n and blending functions fi (t) which define the
curve
X n
P(t) = fi (t)Pi .
i=0

We can select our blending functions such that the curve has any or all of the following properties:

1. Coordinate system independence. This means that the curve will not change if the
coordinate system is changed. In other words, imagine that the control points are drawn on
a piece of paper and we move that piece of paper around so that the (x, y) coordinates of the
control points change. It would be nice if the curve did not change relative to the control
points. Actually, if we were to pick an arbitrary set of blending functions, the curve would
change. In order to provide coordinate system independence, the blending functions must
form a partition of unity, which is math jargon that means that the blending functions sum
identically sum to one:
Xn
fi (t) ≡ 1.
i=0

The property of coordinate system independence is also called affine invariance.

2. Convex hull property. The convex hull property was introduced in Section 2.5. This
property exists in curves which are coordinate system independent and for which the blending
functions are all non- negative:
n
X
fi (t) ≡ 1; fi (t) ≥ 0, 0 ≤ t ≤ 1, i = 0, ..., n
i=0

47
48

3. Symmetry. Curves which are symmetric do not change if the control points are ordered in
reverse sequence. For a curve whose domain is [0, 1], symmetry is assured if and only if
n
X n
X
fi (t)Pi ≡ fi (1 − t)Pn−i .
i=0 i=0

This holds if
fi (t) = fn−i (1 − t).
For a curve whose domain is [t0 , t1 ], symmetry requires
n
X n
X
fi (t)Pi ≡ fi (t0 + t1 − t)Pn−i .
i=0 i=0

4. Variation Diminishing Property. This is a property which is obeyed by Bézier curves and
B-spline curves. It states that if a given straight line intersects the curve in c number of points
and the control polygon in p number of points, then it will always hold that

c = p − 2j

where j is zero or a positive integer. This has the practical interpretation that a curve which

c=3
p=5
j=1

Figure 5.1: Variation Diminishing Property

obeys the variation diminishing property will “wiggle” no more than the control polygon.
The conditions under which a curve will obey the variation diminishing property are rather
complicated. Suffice it to say that Bézier curves and B-spline curves obey this property, and
most other curves do not.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
49

5. Linear Independence. A set of blending functions is linearly independent if there do no


exist a set of constants c0 , . . . , cn , not all zero, for which
n
X
ci fi (t) ≡ 0.
i=0

Linearly independent blending functions are desirable for many reasons. For example,if they
are not linearly independent, it is possible to express one blending function in terms of the
other ones. This has the practical disadvantage that any given curve can be represented by
infinitely many different control point positions. It also means that, for certain control point
arrangements, the curve collapses to a single point, even though the control points are not all
at that point.
If a set of blending functions are linearly independent, they can be called basis functions. Thus,
Bernstein polynomials are basis functions for Bézier curves, and B-spline blending functions
are basis functions.
6. Endpoint Interpolation If a curve over the domain [t0 , t1 ] is to pass through the first and
last control points, as in the case of Bézier curves, the following conditions must be met:

f0 (t0 ) = 1, fi (t0 ) = 0, i = 1, ..., n

fn (t1 ) = 1, fi (t1 ) = 0, i = 0, ..., n − 1.

Any set of blending functions can be analyzed in terms of the above properties.
Example
Check which of the above-mentioned properties are obeyed by the sample curve

t2 − 2t + 1 2t − 2t2 2t2
P(t) = f0 (t)P0 + f1 (t)P1 + f2 (t)P2 = P0 + 2 P1 + 2 P2
t +1
2 t +1 t +1
Answer:
This curve is coordinate system independent because

t2 − 2t + 1 2t − 2t2 2t2 t2 + 1
+ 2 + 2 = 2 ≡ 1.
t +1
2 t +1 t +1 t +1
The curve also obeys the convex hull property because its blending functions are non-negative
for t ∈ [0, 1]. This is most easily seen by factoring the blending functions:

t2 − 2t + 1 (t − 1)2
= 2
t +1
2 t +1
is non-negative for any real number because the square of a real number is always non-negative.

2t − 2t2 2t(1 − t)
= 2
t2 + 1 t +1
is clearly non-negative for t ∈ [0, 1].
The curve is not symmetric because

(1 − t)2 − 2(1 − t) + 1 t2 2t2


= 2 6= 2
(1 − t) + 1
2 t − 2t + 2 t +1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
50 Timmer’s Parametric Cubic

Variation diminishing is very difficult to prove, and will not be attempted here.
Linear independence is assessed by checking if there exist constants c0 , c1 , c2 , not all zero, for
which
t2 − 2t + 1 2t − 2t2 2t2
c0 + c1 + c2 ≡ 0.
t2 + 1 t2 + 1 t2 + 1
This is equivalent to

c0 (t2 − 2t + 1) + c1 (2t − 2t2 ) + c2 (2t2 ) = (c0 − 2c1 + 2c2 )t2 + (−2c0 + 2c1 )t + c0 ≡ 0

which can only happen if

c0 − 2c1 + 2c2 = 0; −2c0 + 2c1 = 0; c0 = 0.

There is no solution to this set of linear equations, other than c0 = c1 = c2 = 0, so we conclude that
these blending functions are linearly independent.
The curve does interpolate the endpoints, because

f0 (0) = 1, f1 (0) = f2 (0) = 0; f2 (1) = 1, f0 (1) = f1 (1) = 0.

The Bézier and B-spline curves are currently the most popular curve forms. Historically, other
curve forms evolved independently at several different industrial sites, each faced with the common
problem of making free-form curves accessible to designers. In this section, we will review three
such curves: Timmer’s Parametric Cubic, Ball’s Cubic, and the Overhauser curve. Each of these
curves is coordinate system independent and symmetric, but only Ball’s cubic obeys the convex hull
property.

5.1 Timmer’s Parametric Cubic

Figure 5.2: Timmer’s PC

Timmer’s Parametric Cubic (or PC) was created by Harry Timmer of McDonnell Douglas [Tim80].
It was modeled after the Bézier curve. Timmer felt that he could improve upon the Bézier curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Ball’s Rational Cubic 51

if he could make it follow the control polygon more tightly. This he did by forcing the curve to
interpolate the endpoints of the control polygon and to be tangent to the control polygon at those
points (just like Bézier curves) and in addition, he forced the curve to go through the midpoint of
the line segment P1 - P2 . The resulting blending functions are:

f0 (t) = (1 − 2t)(1 − t)2 = −2t3 + 5t2 − 4t + 1

f1 (t) = 4t(1 − t)2 = 4t3 − 8t2 + 4t


f2 (t) = 4t2 (1 − t) = −4t3 + 4t2
f3 (t) = (2t − 1)t2 = 2t3 − t2
Figure 5.2 may mislead one into thinking that Timmer’s curve is tangent to P1 − P2 . This is
not generally so (and is not exactly so even in Figure 5.2).

Example Problem
Given a Timmer curve with control points Q0 , Q1 , Q2 , Q3 , find the control points P0 , P1 , P2 , P3
of an equivalent cubic Bézier curve P(t).
Solution
Note that if P(t) ≡ Q(t),then P(0) = Q(0), P(1) = Q(1), P0 (0) = Q0 (0), and P0 (1) = Q0 (1). This
strategy provides a simple way to perform the conversion.

P(0) = Q(0) → P0 = Q0 .

P(1) = Q(1) → P3 = Q3 .
For derivatives, we differentiate the Timmer basis functions (it does not work to use the Bézier
hodograph):

Q0 (t) = (−6t2 + 10t − 4)Q0 + (12t2 − 16t + 4)Q1 + (−12t2 + 8t)Q2 + (6t2 − 2t)Q3

so Q0 (t) = 4(Q1 − Q0 ) and Q0 (1) = 4(Q3 − Q2 ).

P0 + 3P1
P0 (0) = Q0 (0) → 3(P1 − P0 ) = 4(Q1 − Q0 ) → Q1 =
4
P3 + 3P2
P0 (1) = Q0 (1) → 3(P3 − P2 ) = 4(Q3 − Q2 ) → Q2 =
4

5.2 Ball’s Rational Cubic


Alan Ball first published his cubic curve formulation in 1974 [Bal74]. Ball worked for the British
Aircraft Corporation, and his cubic curve form was used in BAC’s in-house CAD system.
Like Timmer’s PC curve, Ball’s cubic can be considered a variant of the cubic Bézier curve.
It’s distinguishing feature is that it handles conic sections as a special case in a natural way. The
blending functions for the non-rational case are:

f0 (t) = (1 − t)2

f1 (t) = 2t(1 − t)2


f2 (t) = 2t2 (1 − t)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
52 Overhauser Curves

f3 (t) = t2
Notice that if P1 = P2 , then the curve becomes a quadratic Bézier curve:
P0 (1 − t)2 + P1 2t(1 − t)2 + P1 2t2 (1 − t) + P3 t2
= P0 (1 − t)2 + P1 [2t(1 − t)2 + 2t2 (1 − t)] + P3 t2
= P0 (1 − t)2 + P1 2t(1 − t) + P3 t2

Figure 5.3: Ball’s Cubic

5.3 Overhauser Curves


Overhauser curves were developed and used at Ford Motor Company [Ove68]. They are also known
as cubic Catmull-Rom splines [CR74].
One complaint of Bézier curves is that the curve does not interpolate all of the control points.
Overhauser curves do interpolate all control points in a piecewise string of curve segments. A single
Overhauser curve is defined with the following blending functions:
1 1
f0 (t) = − t + t2 − t3
2 2
5 2 3 3
f1 (t) = 1 − t + t
2 2
1 3
f2 (t) = t + 2t − t3
2
2 2
1 2 1 3
f3 (t) = − t + t
2 2
A single Overhauser curve segment interpolates P1 and P2 . Furthermore, the slope of the curve at
P1 is only a function of P0 and P2 and the slope at P2 is only a function of P1 and P3 :
1
P0 (0) = (P2 − P0 )
2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Overhauser Curves 53

1
(P3 − P1 )
P0 (1) =
2
This means that a second curve segment will be tangent to the first curve segment if its first three
control points are identical to the last three control points of the first curve. This is illustrated in
Fig. 5.4.

Figure 5.4: Overhauser curves

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
54 Overhauser Curves

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 6

B-Spline Curves

Most shapes are too complicated to define using a single Bézier curve. A spline curve is a sequence
of curve segments that are connected together to form a single continuous curve. For example, a
piecewise collection of Bézier curves, connected end to end, can be called a spline curve. Over-
hauser curves are another example of splines. The word “spline” is sometimes used as a verb, as in
“Spline together some cubic Bézier curves.” In approximation theory, spline is defined as a piecewise
polynomial of degree n whose segments are C n−1 .
The word “spline” comes from the ship building industry, where it originally referred to a thin
strip of wood which draftsmen would use like a flexible French curve. Metal weights (called ducks)
were placed on the drawing surface and the spline was threaded between the ducks as in Figure 6.1.
We know from structural mechanics that the bending moment M is an infinitely continuous function

Figure 6.1: Spline and ducks.

along the spline except at a duck, where M is generally only C 0 continuous. Since the curvature of
the spline is proportional to M (κ = M/EI), the spline is everywhere curvature continuous.
Curvature continuity is an important requirement for the ship building industry, as well as for
many other applications. For example, railroad tracks are always curvature continuous, or else a
moving train would experience severe jolts. Car bodies are G2 smooth, or else the reflection of
straight lines would appear to be G0 .
While C 1 continuity is straightforward to attain using Bézier curves (for example, popular design
software such as Adobe Illustrator use Bézier curves and automatically impose tangent continuity
as you sketch), C 2 and higher continuity is cumbersome. This is where B-spline curves come in.
B-spline curves can be thought of as a method for defining a sequence of degree n Bézier curves that
join automatically with C n−1 continuity, regardless of where the control points are placed.
Whereas an open string of m Bézier curves of degree n involve nm + 1 distinct control points
(shared control points counted only once), that same string of Bézier curves can be expressed using

55
56 Polar Form

only m + n B-spline control points (assuming all neighboring curves are C n−1 ). The most important
operation you need to understand to have a working knowledge of B-splines is how to extract the
contituent Bézier curves. The traditional approach to teaching about B-Splines centered on basis
functions and recurrence relations. Experience has shown that polar form (Section 6.1) and knot
intervals (Section 6.13) provide students with such a working knowledge more quickly than recurrence
relations.

6.1 Polar Form


Polar form, introduced by Dr. Lyle Ramshaw [Ram87, Ram89a, Ram89b], can be thought of as
simply an alternative method of labeling the control points of a Bézier or B-Spline curve. These
labels are referred to as polar values. These notes summarize the properties and applications of
polar form, without delving into derivations. The interested student can study Ramshaw’s papers.
All of the important algorithms for Bézier and B-spline curves can be derived from the following
four rules for polar values.
1. For a degree n Bézier curve P[a,b] (t), the control points are relabeled Pi = P(u1 , u2 , . . . un ) where
uj = a if j ≤ n − i and otherwise uj = b. For a degree two Bézier curve P[a,b] (t),

P0 = P(a, a); P1 = P(a, b); P2 = P(b, b).

For a degree three Bézier curve P[a,b] (t),

P0 = P(a, a, a); P1 = P(a, a, b);

P2 = P(a, b, b); P3 = P(b, b, b),


and so forth.

P(3,4,5)
P(2,3,4) t=4
t=3
P(0,2,2)

P(1,2,3)
P(2,2,2)
P(0,0,2) t=5
P(2,2,3)
P(6,7,8) t=6
P(4,5,6)
P(5,6,7)
P(0,0,0) P(3,3,3)
P(2,3,3) Knot Vector = [1,2,3,4,5,6,7,8]

(a) Bézier curves with polar labels. (b) B-Spline Curve with Polar Labels

Figure 6.2: Polar Labels.

Figure 6.2.a shows two cubic Bézier curves labeled using polar values. The first curve is defined
over the parameter interval [0, 2] and the second curve is defined over the parameter interval [2, 3].
Note that P(t, t, . . . , t) is the point on a Bézier curve corresponding to parameter value t.
2. For a degree n B-spline with a knot vector (see Section 6.2) of

[t1 , t2 , t3 , t4 , . . .],

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Polar Form 57

the arguments of the polar values consist of groups of n adjacent knots from the knot vector, with
the ith polar value being P(ti , . . . , ti+n−1 ), as in Figure 6.2.b.
3. A polar value is symmetric in its arguments. This means that the order of the arguments can be
changed without changing the polar value. For example,

P(1, 0, 0, 2) = P(0, 1, 0, 2) = P(0, 0, 1, 2) = P(2, 1, 0, 0), etc.

4. Given P(u1 , u2 , . . . , un−1 , a) and P(u1 , u2 , . . . , un−1 , b) we can compute P(u1 , u2 , . . . , un−1 , c)
where c is any value:
P(u1 , u2 , . . . , un−1 , c) =
(b − c)P(u1 , u2 , . . . , un−1 , a) + (c − a)P(u1 , u2 , . . . , un−1 , b)
b−a
P(u1 , u2 , . . . , un−1 , c) is said to be an affine combination of P(u1 , u2 , . . . , un−1 , a) and P(u1 , u2 ,
. . . , un−1 , b). For example,

P(0, t, 1) = (1 − t) × P(0, 0, 1) + t × P(0, 1, 1),


(4 − t) × P(0, 2) + (t − 2) × P(0, 4)
P(0, t) = ,
2
(t2 − t) × P(2, 1, 3, t1 ) + (t − t1 ) × P(3, 2, 1, t2 )
P(1, 2, 3, t) = .
(t2 − t1 )
What this means geometrically is that if you vary one parameter of a polar value while holding all
others constant, the polar value will sweep out a line at a constant velocity, as in Figure 6.3.

P(6,c,d)
P(5,c,d)
P(4,c,d)
P(3,c,d)
P(2,c,d)
P(1,c,d)
P(0,c,d)

Figure 6.3: Affine map property of polar values.

6.1.1 Subdivision of Bézier Curves


To illustrate how polar values work, we now show how to derive the de Casteljau algorithm using
only the first three rules for polar values.
Given a cubic Bézier curve P[0,1] (t), we wish to split it into P[0,t] and P[t,1] . The control points
of the original curve are labeled

P(0, 0, 0), P(0, 0, 1), P(0, 1, 1), P(1, 1, 1).

The subdivision problem amounts to finding polar values

P(0, 0, 0), P(0, 0, t), P(0, t, t), P(t, t, t),

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
58 Knot Vectors

and
P(t, t, t), P(t, t, 1), P(t, 1, 1), P(1, 1, 1).
These new control points can be derived by applying the symmetry and affine map rules for polar
values. Refering to Figure 6.4, we can compute

STEP 1.

P(0, 0, t) = (1 − t) × P(0, 0, 0) + (t − 0) × P(0, 0, 1);


P(0, 1, t) = (1 − t) × P(0, 0, 1) + (t − 0) × P(0, 1, 1);
P(t, 1, 1) = (1 − t) × P(0, 1, 1) + (t − 0) × P(1, 1, 1).
STEP 2.

P(0, t, t) = (1 − t) × P(0, 0, t) + (t − 0) × P(0, t, 1);


P(1, t, t) = (1 − t) × P(0, t, 1) + (t − 0) × P(t, 1, 1);
STEP 3.

P(t, t, t) = (1 − t) × P(0, t, t) + (t − 0) × P(t, t, 1);

P(0,1,1)
P(0,t,1)

P(0,0,1) P(0,t,t) P(t,t,1)


P(t) = P(t,t,t) P(t,1,1)
P(0,0,t)

P(1) = P(1,1,1)
P(0) = P(0,0,0)
t = .6

Figure 6.4: Subdividing a cubic Bézier curve.

6.2 Knot Vectors


A knot vector is a list of parameter values, or knots, that specify the parameter intervals for the
individual Bézier curves that make up a B-spline. For example, if a cubic B-spline is comprised of
four Béziercurves with parameter intervals [1, 2], [2, 4], [4, 5], and [5, 8], the knot vector would be

[t0 , t1 , 1, 2, 4, 5, 8, t7 , t8 ].

Notice that there are two (one less than the degree) extra knots prepended and appended to the knot
vector. These knots control the end conditions of the B-spline curve, as discussed in Section 6.6.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Extracting Bézier Curves from B-splines 59

For historical reasons, knot vectors are traditionally described as requiring n end-condition knots,
and in the real world you will always find a (meaningless) additional knot at the beginning and end
of a knot vector. For example, the knot vector in Figure 6.2.b would be [t0 , 1, 2, 3, 4, 5, 6, 7, 8, t9 ],
where the values of t0 and t9 have absolutely no effect on the curve. Therefore, we ignore these
dummy knot values in our discussion, but be aware that they appear in B-spline literature and
software.
Obviously, a knot vector must be non-decreasing sequence of real numbers. If any knot value is
repeated, it is referred to as a multiple knot. More on that in Section 6.4. A B-spline curve whose
knot vector is evenly spaced is known as a uniform B-spline. If the knot vector is not evenly spaced,
the curve is called a non-uniform B-spline.

6.3 Extracting Bézier Curves from B-splines


We are now ready to discuss the central practical issue for B-splines, namely, how does one find
the control points for the Bézier curves that make up a B-spline. This procedure is often called the
Böhm algorithm after Professor Wolfgang Böhm [B8̈1].
Consider the B-spline in Figure 6.2.b consisting of Bézier curves over domains [3, 4], [4, 5], and
[5, 6]. The control points of those three Bézier curves have polar values

P(3, 3, 3), P(3, 3, 4), P(3, 4, 4), P(4, 4, 4)

P(4, 4, 4), P(4, 4, 5), P(4, 5, 5), P(5, 5, 5)

P(5, 5, 5), P(5, 5, 6), P(5, 6, 6), P(6, 6, 6)


respectivly. Our puzzle is to apply the affine and symmetry properties to find those polar values
given the B-spline polar values.
For the Bézier curve over [3, 4], we first find that P(3, 3, 4) is 1/3 of the way from P(2, 3, 4) to
P(5, 3, 4) = P(3, 4, 5). Likewise, P(3, 4, 4) is 2/3 of the way from P(3, 4, 2) = P(2, 3, 4) to P(3, 4, 5).
See Figure 6.5.a.

P(3,3,4) P(3,4,4) P(5,3,4) P(3,3,4) P(3,4,4) P(3,4,5)


P(2,3,4) P(4,4,4) P(4,2,3)
P(3,3,3) P(3,2,3) P(4,4,4) P(4,4,5)
P(3,3,3)
P(1,2,3)
P(1,2,3)
P(6,7,8) t=5 P(6,7,8) t=5
t=6 t=6
P(6,4,5)
P(4,5,6)
P(5,6,7) P(5,6,7)

Knot Vector = [1,2,3,4,5,6,7,8] Knot Vector = [1,2,3,4,5,6,7,8]


(a) First Step. (b) Second Step.

Figure 6.5: Böhm algorithm.

Before we can locate P(3, 3, 3) and P(4, 4, 4), we must find the auxilliary points P(3, 2, 3) (2/3
of the way from P(1, 2, 3) to P(4, 2, 3)) and P(4, 4, 5) (2/3 of the way from P(3, 4, 5) to P(6, 4, 5))

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
60 Multiple knots

as shown in Figure 6.5.b. Finally, P(3, 3, 3) is seen to be half way between P(3, 2, 3) and P(3, 3, 4),
and P(4, 4, 4) is seen to be half way between P(3, 4, 4) and P(4, 4, 5).
Note that the four Bézier control points were derived from exactly four B-spline control points;
P(5, 6, 7) and P(6, 7, 8) were not involved. This means that P(5, 6, 7) and P(6, 7, 8) can be moved
without affecting the Bézier curve over [3, 4]. In general, the Bézier curve over [ti , ti+1 ] is only
influenced by B-spline control points that have ti or ti+1 as one of the polar value parameters. For
this reason, B-splines are said to possess the property of local control, since any given control point
can influence at most n curve segments.

6.4 Multiple knots


If a knot vector contains two identical non-end-condition knots ti = ti+1 , the B-spline can be
thought of as containing a zero-length Bézier curve over [ti , ti+1 ]. Figure 6.9 shows what happens
when two knots are moved together. The Bézier curve over the degenerate interval [5, 5] has polar
values P(5, 5, 5), P(5, 5, 5), P(5, 5, 5), P(5, 5, 5), which is merely the single point P(5, 5, 5). It can be

P(2,3,4.5) P(3,4.5,5) P(2,3,4.9) P(3,4.9,5) P(2,3,5) P(3,5,5)


t=3 t=4.5 t=3 t=3
P(1,2,3) P(1,2,3) t=4.9 P(1,2,3) t=5
P(6,7,8) t=6 t=5 P(6,7,8) t=6 t=5 P(6,7,8) t=6
P(4.5,5,6) P(4.9,5,6) P(5,5,6)
P(5,6,7) P(5,6,7) P(5,6,7)
Knot Vector = [1,2,3,4.5,5,6,7,8] Knot Vector = [1,2,3,4.9,5,6,7,8] Knot Vector = [1,2,3,5,5,6,7,8]

Figure 6.6: Double knot.

shown that a multiple knot diminishes the continuity between adjacent Bézier curves. The continuity
across a knot of multiplicity k is generally n − k.

6.5 Periodic B-splines


A periodic B-spline is a B-spline which closes on itself. This requires that the first n control points
are identical to the last n, and the first n parameter intervals in the knot vector are identical to the
last n intervals as in Figure 6.7.a.

6.6 Bézier end conditions


We earlier noted that a knot vector always has n − 1 extra knots at the beginning and end which
do not signify Bézier parameter limits (except in the periodic case), but which influence the shape
of the curve at its ends. In the case of an open (i.e., non-periodic) B-spline, one usually chooses
an n-fold knot at each end. This imposes a Bézier behavior on the end of the B-spline, in that the
curve interpolates the end control points and is tangent to the control polygon at its endpoints. One
can verify this by noting that to convert such a B-spline into Bézier curves, the two control points
at each end are already in Bézier form. This is illustrated in Figure 6.7.b.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Knot insertion 61

P(11,12,14) P(0,1,3)
P(10,11,12) P(4,5,7) P(0,0,1)
P(3,4,5) t=1
t=5,12
t=4,11
P(0,0,0) t=0
t=10
P(8,10,11) t=4
P(4,4,4) t=3
P(1,3,4) t=7
t=8
P(5,7,8) P(1,3,4)
P(7,8,10) P(3,4,4)
Knot Vector = [1 3 4 5 7 8 10 11 12 14]
Knot Vector = [0,0,0,1,3,4,4,4]
(a) Periodic B-Spline. (b) Bézier End Conditions.

Figure 6.7: Special B-Spline Curves.

6.7 Knot insertion


A standard design tool for B-splines is knot insertion. In the knot insertion process, a knot is added
to the knot vector of a given B-spline. This results in an additional control point and a modification
of a few existing control points. The end result is a curve defined by a larger number of control
points, but which defines exactly the same curve as before knot insertion.
Knot insertion has several applications. One is the de Boor algorithm for evaluating a B-spline
(discussed in the next section). Another application is to provide a designer with the ability to add
local details to a B-spline. Knot insertion provides more local control by isolating a region to be
modified from the rest of the curve, which thereby becomes immune from the local modification.
Consider adding a knot at t = 2 for the B-spline in Figure 6.7.b. As shown in Figure 6.8.a, this in-
volves replacing P(0, 1, 3) and P(1, 3, 4) with P(0, 1, 2), P(1, 2, 3), and P(2, 3, 4). Figure 6.8.b shows
the new set of control points, which are easily obtained using the affine and symmetry properties of
polar values.

P(0,1,2) P(0,1,3)
Initial After Knot Insertion
P(0,0,1)
Knot Vector: [(0,0,0,1,3,4,4,4)] [(0,0,0,1,2,3,4,4,4)] t=1
Control Points: P(0,0,0) P(0,0,0)
P(0,0,1) P(0,0,1) t=2 P(1,2,3)
P(0,1,2) P(0,0,0) t=0
P(4,4,4) t=4
P(0,1,3)
P(1,2,3) t=3
P(1,3,4) P(3,4,4) P(1,3,4)
P(2,3,4) P(2,3,4)
P(3,4,4) P(3,4,4) Old Knot Vector = [0,0,0,1,3,4,4,4]
P(4,4,4) P(4,4,4) New Knot Vector = [0,0,0,1,2,3,4,4,4]
(a) Knots and Polar Labels. (b) Control Points.

Figure 6.8: Knot Insertion.

Note that the continuity at t = 2 is C ∞ .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
62 The de Boor algorithm

Example
This degree four polynomial Bézier curve begins at t = 1 and ends at t = 5, and is therefore also
a B-spline with knot vector [11115555]. Insert a knot at t = 3. State the control point coordinates
and knot vector after this knot insertion is performed.

P2 = (4,7)

P3 = (7,4)
P1 = (1,4)

P0 = (1,1) P4 = (7,1)

Figure 6.9: B-spline with knot vector [11115555].

Solution
The control points whose polar labels are f (1, 1, 1, 5) = (1, 4), f (1, 1, 5, 5) = (4, 7) and f (1, 5, 5, 5) =
(7, 4) will be replaced with polar labels f (1, 1, 1, 3) = (1, 2.5), f (1, 1, 3, 5) = (2.5, 5.5), f (1, 3, 5, 5) =
(5.5, 5.5), and f (3, 5, 5, 5) = (7, 2.5).

6.8 The de Boor algorithm


The de Boor algorithm provides a method for evaluating a B-spline curve. That is, given a parameter
value, find the point on the B-spline corresponding to that parameter value.
Any point on a B-spline P(t) has a polar value P(t, t, . . . , t), and we can find it by inserting knot
t n times. This is the de Boor algorithm. Using polar forms, the algorithm is easy to figure out.
The de Boor algorithm is illustrated in Figure 6.10.

6.9 Explicit B-splines


Section 2.14 discusses explicit Bézier curves, or curves for which x(t) = t. We can likewise locate
B-spline control points in such a way that x(t) = t. The x coordinates for an explicit B-spline are
known as Greville abscissae. For a degree n B-spline with m knots in the knot vector, the Greville
abscissae are given by
1
xi = (ti + ti+1 + . . . + ti+n−1 ); i = 0 . . . m − n. (6.1)
n

6.10 B-spline hodographs


The first derivative (or hodograph) of a B-spline is obtained in a manner similar to that for Bézier
curves. The hodograph has the same knot vector as the given B-spline except that the first and last
knots are discarded. The control points are given by the equation
(Pi+1 − Pi )
Hi = n (6.2)
ti+n − ti
where n is the degree.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Symmetric polynomials 63

P(0,1,2) P(0,1,3)

P(0,0,1)
P(1,2,2)
P(2,2,2) P(1,2,3)
P(0,0,0) t=0
P(2,2,3)
P(4,4,4) t=4

P(3,4,4) P(1,3,4)
P(2,3,4)
Old Knot Vector = [0,0,0,1,3,4,4,4]
New Knot Vector = [0,0,0,1,2,2,2,3,4,4,4]

Figure 6.10: De Boor algorithm.

6.11 Symmetric polynomials


We introduced polar form as simply a labeling scheme, with rules defined for creating new control
points with different labels. As we have seen, this level of understanding is sufficient to perform
many of the basic operations on B-Spline curves. However, there is some beautiful mathematics
behind these labels, based on symmetric polynomials.
A symmetric polynomial represents a degree m polynomial in one variable, p(t), as a polynomial
in n ≥ m variables, p[t1 , . . . , tn ], that is degree one in each of those variables and such that

p[t, . . . , t] = p(t).

p[t1 , . . . , tn ] is said to be symmetric because the value of the polynomial will not change if the
arguments are permuted. For example, if n = 3, p[a, b, c] = p[b, c, a] = p[c, a, b] etc.
A symmetric polynomial has the form
n
X
p[t1 , . . . , tn ] = ci pi [t1 , . . . , tn ]
i=0

where
Pn
j=1 tj pi−1 [t1 , . . . , tj−1 , tj+1 , . . . , tn ]
p0 [t1 , . . . , tn ] = 1; pi [t1 , . . . , tn ] = , i = 1, . . . n.
n
For example,
p[t1 ] = c0 + c1 t1 ,
t1 + t2
p[t1 , t2 ] = c0 + c1 + c2 t 1 t 2 ,
2
t1 + t2 + t3 t1 t2 + t1 t3 + t2 t3
p[t1 , t2 , t3 ] = c0 + c1 + c2 + c3 t 1 t 2 t 3 ,
3 3
and
t1 + t2 + t3 + t4 t1 t2 + t1 t3 + t1 t4 + t2 t3 + t2 t4 + t3 t4
p[t1 , t2 , t3 , t4 ] = c0 + c1 + c2
4 6
t1 t2 t3 + t1 t2 t4 + t1 t3 t4 + t2 t3 t4
+c3 + c4 t1 t2 t3 t4 .
4

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
64 Combining Bézier curves into a B-spline

The symmetric polynomial b[t1 , . . . tn ] for which p[t, . . . t] = p(t) is referred to as the polar form or
blossom of p(t).

Example Find the polar form of p(t) = t3 + 6t2 + 3t + 1.


Answer: p[t1 , t2 , t3 ] = 1 + 3 t1 +t32 +t3 + 6 t1 t2 +t13t3 +t2 t3 + t1 t2 t3 .

Theorem For every degree m polynomial p(t) there exists a unique symmetric polynomial p[t1 , . . . , tn ]
of degree n ≥ m such that p[t, . . . , t] = p(t). Furthermore, the coefficients bi of the degree n Bernstein
polynomial over the interval [a, b] are
bi = p[a, . . . , a, b, . . . , b]
| {z } | {z }
n−i i

Example Convert p(t) = t3 + 6t2 + 3t + 1 to a degree 3 Bernstein polynomial over the interval [0, 1].
We use the polar form of p(t): p[t1 , t2 , t3 ] = 1 + 3 t1 +t32 +t3 + 6 t1 t2 +t13t3 +t2 t3 + t1 t2 t3 . Then,
b0 = p[0, 0, 0] = 1, b1 = p[0, 0, 1] = 2, b2 = p[0, 1, 1] = 5, b3 = p[1, 1, 1] = 11.

6.12 Combining Bézier curves into a B-spline


Here we suggest how to convert a string of cubic Bézier curves into a single B-spline. The process
initializes by assigning the first four B-spline control points to be the control points of the first Bézier
curve, and the knot vector is initially [0, 0, 0, 0, 1, 1, 1, 1].
Thereafter, each subsequent Bézier curve is analyzed to determine what order of continuity exists
between it and the current B-spline, and it is appended to the B-spline as follows. Assume that at
some step in this process, the B-spline has a knot vector [ki−3 , ki−2 , ki−1 , ki , ki+1 , ki+1 , ki+1 , ki+1 ]
with ki−2 ≤ ki−1 ≤ ki < ki+1 , and the B-spline control points are labelled
P1 , . . . , Pn−3 , Pn−2 , Pn−1 , Pn .
The control points of the Béziercurve to be appended are
Q0 = Pn , Q1 , Q2 , Q3 .
Then, depending on the continuity order between the B-spline and the Bézier curve, the B-spline
after appending the Bézier becomes

Continuity Knot Vector Control Points


C0 [. . . , ki−2 , ki−1 , ki , ki+1 , ki+1 , ki+1 , e, e, e, e] . . . , Pn−3 , Pn−2 , Pn−1 , Pn , Q1 , Q2 , Q3
C1 [. . . , ki−2 , ki−1 , ki , ki+1 , ki+1 , e, e, e, e] . . . , Pn−3 , Pn−2 , Pn−1 , Q1 , Q2 , Q3
C2 [. . . , ki−2 , ki−1 , ki , ki+1 , e, e, e, e] . . . , Pn−3 , Pn−2 , Pα , Q2 , Q3
C3 [. . . , ki−2 , ki−1 , ki , e, e, e, e] . . . , Pn−3 , Pβ , Pγ , Q3

C 0 continuity occurs if control points Pn−1 , Pn , and Q1 are not collinear. If they are collinear, then
the value of knot e is chosen so as to satisfy
|[Pn − Pn−1 ](ki+1 − ki ) − [Q1 − Pn ](e − ki+1 )| < T OL
This provides for C 1 (not merely G1 ) continuity. T OL is a small number which is needed to account
for floating point error. An appropriate value for T OL is the width of the reverse map of a pixel
into world space.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Knot Intervals 65

C 2 continuity occurs if, in addition to C 1 continuity, the relationship

|(Pn−2 − Q2 )(ki+1 − ki−1 )(ki+1 − e) + (Pn−1 − Pn−2 )(e − ki−1 )(ki+1 − e) + (Q2 − Q1 )(ki − e)(ki+1 − ki−1 )| < T OL.

is satisfied. We can then compute

(ki+1 − e)Pn−2 + (e − ki−1 )Pn−1 (ki+1 − ki )Q2 + (e − ki+1 )Q1


Pα = = .
ki+1 − ki−1 e − ki

C 3 continuity occurs if, further, the relationship

Pα − (e − ki+1 )Pβ + (ki+1 − ki−1 )Pγ < T OL




e − ki−1

is satisfied, where
(e − ki−2 )Pn−2 + (ki−1 − e)Pn−3
Pβ =
ki−1 − ki−2
and
(ki+1 − ki )Q3 + (ki − e)Q2
Pγ =
ki+1 − e

6.13 Knot Intervals


B-spline curves are typically specified in terms of a set of control points, a knot vector, and a
degree. Knot information can also be imposed on a B-spline curve using knot intervals, introduced
in [SZSS98] as a way to assign knot information to subdivision surfaces. A knot interval is the
difference between two adjacent knots in a knot vector, i.e., the parameter length of a B-spline curve
segment. For even-degree B-spline curves, a knot interval is assigned to each control point, since each
control point in an even-degree B-spline corresponds to a curve segment. For odd-degree B-spline
curves, a knot interval is assigned to each control polygon edge, since in this case, each edge of the
control polygon maps to a curve segment.
While knot intervals are basically just an alternative notation for representing knot vectors, knot
intervals offer some nice advantages. For example, knot interval notation is more closely coupled to
the control polygon than is knot vector notation. Thus, knot intervals have more geometric meaning
than knot vectors, since the effect of altering a knot interval can be more easily predicted. Knot
intervals are particularly well suited for periodic B-splines.
Knot intervals contain all of the information that a knot vector contains, with the exception
of a knot origin. This is not a problem, since the appearance of a B-spline curve is invariant
under linear transformation of the knot vector—that is, if you add any constant to each knot the
curve’s appearance does not change. B-splines originated in the field of approximation theory and
were initially used to approximate functions. In that context, parameter values are important, and
hence, knot values are significant. However, in curve and surface shape design, we are almost never
concerned about absolute parameter values.
For odd-degree B-spline curves, the knot interval di is assigned to the control polygon edge
Pi —Pi+1 . For even-degree B-spline curves, knot interval di is assigned to control point Pi . Each
vertex (for even degree) or edge (for odd degree) has exactly one knot interval. If the B-spline is
not periodic, n−12 “end-condition” knot intervals must be assigned past each of the two end control
points. They can simply be written adjacent to “phantom” edges or vertices sketched adjacent to
the end control points; the geometric positions of those phantom edges or vertices are immaterial.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
66 Knot Intervals

P(3,4,6) d1=1 P2
P1
P(2,3,4) t=4 d0=1 t=4
t=3 d-1=1 t=3
P0 d2=2
P(1,2,3) t=6 t=6
d5=1 P5
P(9,10,11) t=9 t=9
d4=1
P(4,6,9) P3
P(6,9,10) P4 d3=3

Knot Vector = [1,2,3,4,6,9,10,11] Knot Vector = [1,2,3,4,6,9,10,11]

Figure 6.11: Sample cubic B-spline

Figure 6.11 shows a cubic B-spline curve. The control points in Figure 6.11.a are labeled with
polar values, and Figure 6.11.b shows the control polygon edges labeled with knot intervals. End-
condition knots require that we hang one knot interval off each end of the control polygon. Note
the relationship between the knot vector and the knot intervals: Each knot interval is the difference
between two consecutive knots in the knot vector.
For periodic B-splines, things are even simpler, since we don’t need to deal with end conditions.
Figure 6.12 shows two cubic periodic B-splines labelled with knot intervals. In this example, note

P1 P1

d0= 1
d1= 1 d0= 2
d1= 3
P0 P2 P0 P2

d4= 1 d2= 1
d4= 1 d2= 2

P4 P3 P4 P3
d3= 1 d3= 1

Figure 6.12: Periodic B-splines labelled with knot intervals

that as knot interval d1 changes from 1 to 3, the length of the corresponding curve segment increases.
Figure 6.13 shows two periodic B-splines with a double knot (imposed by setting d0 = 0) and a
triple knot (set d0 = d1 = 0).
In order to determine formulae for operations such as knot insertion in terms of knot intervals,
it is helpful to infer polar labels for the control points. Polar algebra [Ram89b] can then be used to
create the desired formula. The arguments of the polar labels are sums of knot intervals. We are
free to choose any knot origin. For the example in Figure 6.14, we choose the knot origin to coincide
with control points P0 . Then the polar values are as shown in Figure 6.14.b.
The following subsections show how to perform knot insertion and interval halving, and how
to compute hodographs using knot intervals. These formulae can be verified using polar labels.
The expressions for these operations written in terms of knot vectors can be found, for example,
in [HL93].

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Knot Intervals 67

P1 P1

d0= 0 d1= 1
d0= 0 d1= 0

P0 P2 P0 P2

d2= 1
d4= 1
d4= 1 d 2= 1

P4 P3 P4 P3
d3= 1 d3= 1

Figure 6.13: Periodic B-splines with double and triple knots.

P1 f(0,d0,d0+d1)

d0 d1 d0 d1

P0 f(-d4,0,d0)
P2 f(d0,d0+d1,d0+d1+d2)

d4 d2 d4 d2

P4 d3 P3 P4 d3 f(d0+d1,d0+d1+d2,d0+d1+d2+d3)
b

Figure 6.14: Inferring polar labels from knot intervals.

6.13.1 Knot Insertion


Recall from Section 6.7 that knot insertion is a fundamental operation whereby control points are
added to a B-Spline control polygon without changing the curve. In Section 6.7, knot insertion
is discussed in terms of knot vectors and polar form. We can perform knot insertion using knot
intervals, as well. In fact, the construction algorithm is perhaps even easier to remember and to
carry out than the polar form construction.
Using knot intervals, it is more natural to speak of interval splitting than of knot insertion. For
example, Figure 6.15 shows a cubic periodic B-Spline in which the red knot interval is split into two
knot intervals that sum to the original knot interval. The only question we need to address is, how
can we compute the Cartesian coordinates of the white control points in Figure 6.15.b.
Figure 6.16 illustrates how to compute those control points. Split the white, red, and green edges
of the control polygon into three segments each whose lengths are proportional to the neighboring
knot intervals, as shown in Figure 6.16.a. Each of those three edges contains a segment labeled
with a red “3.” Split each of those segments into two pieces whose lengths are proportional to 1:2,
as shown in Figure 6.16.b. This produces the three desired control points. Figure 6.17 shows the
procedure for splitting the interval “3” into two equal intervals.
An important special case involves inserting a zero knot interval. In knot vector jargon, this is
the same as inserting a double knot. In knot interval jargon, we can say that we are splitting a knot
interval into two intervals, one of which is zero, and the other of which is the original knot interval.
This special case is illustrated in Figure 6.18.a and Figure 6.18.b. If we repeat this operation three

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
68 Knot Intervals

3 1
2

2
1

1
2 2
(a) Periodic Cubic B-Spline Labeled with Knot In- (b) Splitting Interval 3 into Intervals 1 and 2.
tervals.

Figure 6.15: Knot Insertion using Knot Intervals.

2
2 3 2
3

3 1
1

2
2

1
2

1
1

1
3

1
2

1
1

1
2

2
(a) Dividing Edges of the Control Polygon into Three (b) Splitting Intervals Labeled with a 3 into Intervals
Segments Whose Lengths are Proportional to the 1 and 2.
Neighboring Knot Intervals.

Figure 6.16: “Interval Splitting” using Knot Intervals.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Knot Intervals 69

1.5 2

5
1.
1.5

5
1.
2

1.5

2
1.5
1

1.5
1.5
1

1
1

2
2
(a) Splitting the Interval Labeled with a 3 into In- (b) Construction.
tervals 1.5 and 1.5.

Figure 6.17: “Interval Splitting” using Knot Intervals.

more times, arriving at the knot interval configuration shown in Figure 6.18.c, we uncover the Bézier
control points for the red Bézier curve. The reason for this will be clear if you recall that a Bézier
curve is a special case of B-Spline curve with knot vector [a, a, a, b, b, b]. Converting from knot vector
to knot interval notation, we see that the two pairs of adjacent zero knot interval in Figure 6.18.c
represent two sets of triple knots in the knot vector.

2
0

3 0 0
3
3
2

3
2

0
2

1
1

0
0

0
1

1
10
1

1
2

2 2

(a) Splitting the Interval La- (b) Construction. (c) Bézier control points.
beled with a 3 into Intervals 3
and 0.

Figure 6.18: Introducing Zero Knot Intervals.

6.13.2 Interval Halving


Subdivision surfaces such as the Catmull-Clark scheme are based on the notion of inserting a knot
half way between each existing pair of knots in a knot vector. These methods are typically restricted
to uniform knot vectors. Knot intervals help to generalize this technique to non-uniform B-splines.
Using knot intervals, we can think of this process as cutting in half each knot interval. For a quadratic

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
70 Knot Intervals

non-uniform B-spline, the interval halving procedure is a generalization of Chaikin’s algorithm, but
the placement of the new control points becomes a function of the knot interval values. If each knot
interval is cut in halve, the resulting control polygon has twice as many control points, and their
coordinates Qk are:
(di + 2di+1 )Pi + di Pi+1
Q2i =
2(di + di+1 )
di+1 Pi + (2di + di+1 )Pi+1
Q2i+1 = (6.3)
2(di + di+1 )
as illustrated in Figure 6.19.
di di
Q2i-1 Q2i
di/2 di/2 Q2i+1
di-1
di+1/2 di+1
Pi-1 Pi+1
di-1 di+1

Figure 6.19: Interval halving for a non-uniform quadratic B-spline curve.

For non-uniform cubic periodic B-spline curves, interval halving produces a new control point
corresponding to each edge, and a new control point corresponding to each original control point.
The equations for the new control points Qk generated by interval halving are:
(di + 2di+1 )Pi + (di + 2di−1 )Pi+1
Q2i+1 = (6.4)
2(di−1 + di + di+1 )
di Q2i−1 + (di−1 + di )Pi + di−1 Q2i+1
Q2i = (6.5)
2(di−1 + di )
as shown in Figure 6.20.

Q2i
di-1
Q2i+1
Q2i-1 di-1/2 di/2 di
Pi-1 Pi+1
di 2 di 1

Figure 6.20: Interval halving for a non-uniform cubic B-spline curve.

Note that each new knot interval is half as large as its parent.

6.13.3 Degree-Two B-Splines using Knot Intervals


For any odd-degree B-Spline curve, the knot intervals are associated with the edges of the control
polygon. For even-degree, the knot intervals are associated with the control points. Figure 6.21
shows two quadratic B-Splines with different knot intervals.
Figure 6.22 illustrates how to perform interval splitting for a quadratic B-Spline. Figure 6.23
illustrates how to split off a zero-knot interval on a quadratic B-Spline. To find the Bézier control
points in a quadratic B-Spline, it suffices to insert a single zero knot interval on each side of a
non-zero knot interval.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Knot Intervals 71

3 3

2 1 2 0

1 2 1 2
(a) Example 1. (b) Example with Zero Knot Interval.

Figure 6.21: Quadratic B-Spline Curves.

3
1.5
5
1.

1.5 1.5
1.5
5
1.

1
2

2 1 2 1

1 2 1 2
(a) Splitting the Knot Interval 3 into two (b) Construction for the Interval Splitting.
equal knot intervals.

Figure 6.22: Interval Splitting of a Quadratic B-Spline Curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
72 Knot Intervals

3 3

0
3

3
0
0 1

2
2 1 2 1

1 2 1 2
(a) Splitting the Knot Interval 3 into two (b) Construction for the Interval Splitting.
equal knot intervals.

Figure 6.23: Interval Splitting of a Quadratic B-Spline Curve.

6.13.4 Hodographs
Section 2.7 discusses the hodograph of a polynomial Bézier curve. The hodograph of a polynomial
B-Spline curve can be constructed in a similar manner.

3 1 2
2

1 3
1

Hodograph
2
.

Figure 6.24: Hodograph of a Degree 3 Polynomial B-Spline Curve.

Figure 6.24 shows a cubic B-Spline curve and its hodograph, represented as a degree-two B-Spline
curve. Note the relationship between the knot vectors in the original curve and in its hodograph.
The control points for the hodograph are found in a manner similar to the control points for a Bézier
hodograph.
The exact formula for the control points, as illustrated in Figure 6.25, is as follows. The hodo-
graph of a degree n B-spline P(t) with knot intervals di and control points Pi is a B-spline of degree
n − 1 with the same knot intervals di and with control points Qi where

Qi = ci (Pi+1 − Pi ). (6.6)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Knot Intervals 73

V
3 3V 3
2

2
1+2+3
V
(0,0) (0,0)

3V
1

1
2+3+1

(a) (b)

Figure 6.25: Finding the Control Points of a B-Spline Hodograph.

The scale factor ci is the inverse of the average value of n neighboring knot intervals. Specifically, if
the curve is even-degree n = 2m, then
n
ci =
di−m+1 + . . . + di+m
and if the curve is odd degree n = 2m + 1
n
ci =
di−m + . . . + di+m

6.13.5 Degree elevation


Ramshaw [Ram89b] presented an elegant insight into degree elevation using polar form. The sym-
metry property of polar labels demands that
f (a) + f (b) f (a, b) + f (a, c) + f (b, c)
f (a, b) = ; f (a, b, c) = ; (6.7)
2 3
f (a, b, c) + f (a, b, d) + f (a, c, d) + f (b, c, d)
f (a, b, c, d) = ; etc. (6.8)
4
The procedure of degree elevation on a periodic B-spline that is labeled using knot intervals
results in two effects. First, an additional control point is introduced for each curve segment.
Second, if the sequence of knot intervals is initially d1 , d2 , d3 , . . ., the sequence of knot intervals on
the degree elevated control polygon will be d1 , 0, d2 , 0, d3 , 0, . . .. The zeroes must be added because
degree elevation raises the degree of each curve segment without raising the continuity between curve
segments,
Degree elevation of a degree one B-spline is simple: merely insert a new control point on the
midpoint of each edge of the control polygon. The knot intervals are as shown in Figures 6.26.a and
b.
Degree elevation for a degree two B-spline is illustrated in Figures 6.26.c and d. The new control
points are:
(2di + 3dj )Pi + di Pj
Pi,j = . (6.9)
3di + 3dj
Figure 6.27 illustrates degree elevation from degree three to four. The equations for the new
control points are:
(di + 2di+1 )Pi + (2di−1 + di )Pi+1
Pi,i+1 =
2(di−1 + di + di+1 )

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
74 Knot Intervals

.
d1 d1 P2 P12 0 P21 d2
0 P1 d2
P2 0 d1 d1
P1 P1 P12 P2 P23
P10
d0 d2 d0 d2
P23 0 0
P01
P01
P0 P3 P0 P3 P0 P3 P32
0 0 d0 d3 d0 d3
d3 d3 P03 0 P30
a. Degree one B-spline b. Degree elevation of (a.) c. Degree two B-spline b. Degree elevation of (c.)

Figure 6.26: Degree elevating a degree one and degree two B-spline.

P2 d2 P3 d2
0
Q2 0 P23 Q3 d3
d3
P34
d1 d1 P12
P4
0 Q1
P1
d0 P0 d P01
0

a. Cubic B-spline. b. Degree elevated.

Figure 6.27: Degree elevating a degree three B-spline.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
B-spline Basis Functions 75

di−2 + di−1 di + di+1 1


 
di di−1
Qi = Pi−1 + + + Pi + Pi+1
4(di−2 + di−1 + di ) 4(di−2 + di−1 + di ) 4(di−1 + di + di+1 ) 2 4(di−1 + di + di+1 )

6.14 B-spline Basis Functions


A degree d B-spline curve with n control points can be expressed
n
X
P(t) = Pi Bid (t).
i=1

The knot vector for this curve contains n + d − 1 knots, which we will denote [t1 , t2 , . . . , tn+d−1 ].
Thus, control point Pi has polar label f (ti , . . . , ti+d−1 ).
Each B-spline basis function Bid (t) can be expressed as an explicit B-spline curve whose x coor-
dinates are the Greville abscissae (Section 6.9) and whose y coordinates are all zero except yi = 1.
Each basis function is a piecewise polynomial that has d + 1 non-zero segments. For example, the
cubic B-spline in Figure 6.28, n = 7 and the knot vector is [0, 0, 0, 2, 3, 4, 5, 5, 5]. The basis function

P4= f(2,3,4)

P3= f(0,2,3) P5= f(3,4,5)

P6= f(4,5,5)

P2= f(0,0,2)

P1= f(0,0,0) P7= f(5,5,5)


.

Figure 6.28: Cubic B-Spline Curve.

B33 (t) is shown in Figure 6.29.

B33 (t) f(0,2,3) = (5/3,1)

f(5,5,5)
= (5,0) t
f(0,0,0) f(0,0,2) f(2,3,4) f(3,4,5) f(4,5,5)
= (0,0) = (2/3,0) = (3,0) = (4,0) = (14/3,0)
.

Figure 6.29: Basis function B33 (t).

The basis function in Figure 6.29 is just like any other B-Spline curve. To evaluate B33 (t), we
compute polar value f (t, t, t) using knot insertion. The y coordinate of f (t, t, t) is B33 (t), and the
x-coordinate of f (t, t, t) is t.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
76 B-spline Basis Functions

The support of a basis function is the set of t values for which the basis function is non-zero. For
a degree-three curve, the basis function for the control point whose polar label is f (tj−1 , tj , tj+1 ) has
support tj−2 < t < tj+2 = (tj−2 , tj+2 ). The domain D of the B-spline curve is the set of t parameter
values over which the curve is defined, so after eliminating the end-condition knots, D = [td , tn ].
Since support has little practical meaning outside the domain of the curve, it is more correct to say
that (tj−2 , tj+2 ) ∩ D is the domain for the basis function for the control point whose polar label is
f (tj−1 , tj , tj+1 ).
In general, for a degree-d B-spline curve, the support of Bin (t) is (ti−1 , ti+d ) ∩ D.

6.14.1 B-Spline Basis-Functions using Knot Intervals


Basis functions for B-Splines defined using knot intervals can likewise be represented as explicit
B-Spline curves (Section 6.9). For the curve in Figure 6.30, the basis function for Pi is illustrated
in Figure 6.31.

Pi
d i-1 di
P i-1 P i+1

d i+1

P i-2 P i+2

P i+3
.

Figure 6.30: Sample Cubic B-Spline Curve.

B(t)

1
d i-1 di

0 t
d i-2 d i+1
. t1 t2 t3 t4 t5

Figure 6.31: B-Spline Basis Function for Control Point Pi in Figure 6.30.

B(t) is the y-coordinates the curve in Figure 6.31. Those y-coordinates are easily evaluated in

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
B-spline Basis Functions 77

the same manner as you would evaluate a point on any B-Spline curve. Note that the y-coordinates
of the control points of this explicit B-Spline curve are all zero, except for the control point whose
basis function we desire.
If we now evaluate a point on this explicit B-Spline curve using the knot-interval version of the de
Boor algorithm, we arrive at the following equations for the B-Spline basis function in Figure 6.31.
For t ∈ [t1 , t2 ]:
(t − t1 )3
B(t) = (6.10)
(t4 − t1 )(t3 − t1 )( t2 − t1 )
For t ∈ [t2 , t3 ]:

(t − t2 )2 (t5 − t) (t − t2 )(t − t1 )(t4 − t) (t3 − t)(t − t1 )2


B(t) = + + (6.11)
(t5 − t2 )(t4 − t2 )(t3 − t2 ) (t4 − t1 )(t4 − t2 )(t3 − t2 ) (t4 − t1 )(t3 − t1 )(t3 − t2 )

For t ∈ [t3 , t4 ]:

(t4 − t)2 (t − t1 ) (t4 − t)(t5 − t) (t − t2 ) (t − t3 )(t5 − t)2


B(t) = + + (6.12)
(t4 − t1 )(t4 − t2 )(t4 − t3 ) (t5 − t2 )(t4 − t2 )(t4 − t3 ) (t5 − t2 )(t5 − t3 )(t4 − t3 )

For t ∈ [t4 , t5 ]:
(t5 − t)3
B(t) = (6.13)
(t5 − t2 )(t5 − t3 )( t5 − t4 )
These four polynomials are C 2 , with

3(t2 − t1 ) 6
B 0 (t1 ) = B 00 (t1 ) = 0, B 0 (t2 ) = , B 00 (t2 ) = ,
(t3 − t1 )(t4 − t1 ) (t3 − t1 )(t4 − t1 )

3(t1 (t2 − t3 ) − t2 t3 + t3 t4 + t3 t5 − t4 t5 ) 6(t1 + t2 − t4 − t5 )


B 0 (t3 ) = , B 00 (t3 ) =
(t1 − t4 )(t2 − t4 )(t2 − t5 ) (t1 − t4 )(t4 − t2 )(t2 − t5 )
3(t5 − t4 ) 6
B 0 (t4 ) = − , B 00 (t4 ) =
(t5 − t2 )(t5 − t3 ) (t5 − t2 )(t5 − t3 )

6.14.2 Refinement of B-Spline Basis Functions


Denote by
N [s0 , s1 , . . . , sn+1 ](s)
a B-Spline basis function of degree n over a knot vector {s0 , s1 , . . . , sn+1 } and with support [s0 , sn+1 ].
Upon inserting a knot k for which si ≤ k ≤ si+i , the basis function is split into two scaled basis
functions:

N [s0 , s1 , . . . , sn+1 ](s) = ci N [s0 , . . . , si , k, si+1 , . . . , sn ](s) + di N [s1 , . . . , si , k, si+1 , . . . , sn+1 ](s)

where  k−s0
k < sn
ci = sn+1 −s0
1 k ≥ sn
(
sn+1 −k
k > s1
di = sn+1 −s1
1 k ≤ s1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
78 B-spline Basis Functions

6.14.3 Recurrence Relation


B-spline basis functions can also be defined using the following recurrence relations.
A degree zero B-spline curve is defined over the interval [ti , ti+1 ] using one control point, P0 . Its
basis function, which we will denote Bi0 (t) is the step function

1 if ti ≤ t ≤ ti+1

bi (t) =
0
0 otherwise.

The curve Bi0 (t)P0 consists of the discrete point P0 .


Blending functions for higher degree B-splines are defined using the recurrence relation:

Bik (t) = ωik (t)Bik−1 (t) + (1 − ωi+1


k
(t))Bi+1
k−1
(t) (6.14)

where
t−ti
if ti 6= ti+k−1

ωik (t) = ti+k−1 −ti
0 otherwise.
A degree one B-spline curve is defined over the interval [ti , ti+1 ] using two control points, which
we will denote as polar values P(ti ) and P(ti+1 ). The curve is simply the line segment joining the
two control points:
ti+1 − t t − ti
P(t) = P(ti ) + P(ti+1 ).
ti+1 − ti ti+1 − ti
A single degree n B-spline curve segment defined over the interval [ti , ti+1 ] with knot vector
{. . . , ti−1 , ti , ti+1 , ti+2 , . . .} has n + 1 control points written as polar values

P(ti+1−n , . . . , ti ), . . . , P(ti+1 , . . . , ti+n )

and blending functions Bin (t) which are obtained from equation 6.14. The equation for the curve is:
n+i
X
P(t) = n
Bj+1−n (t)P(tj+1−n , . . . , tj ) (6.15)
j=i

In approximation theory, the basis functions themselves are referred to as B-splines.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 7

Planar Curve Intersection

Curve intersection involves finding the points at which two planar curves intersect. If the two curves
are parametric, the solution also identifies the parameter values of the intersection points.

7.1 Bezout’s Theorem


Bezout’s theorem states that a planar algebraic curve of degree n and a second planar algebraic
curve of degree m intersect in exactly mn points, if we properly count complex intersections, inter-
sections at infinity, and possible multiple intersections. If they intersect in more than that number
of points, they intersect in infinitely many points. This happens if the two curves are identical, for
example.
The correct accounting of the multiplicity of intersections is essential to properly observe Bezout’s
theorem. If two curves intersect and they are not tangent at the point of intersection (and they
do not self-intersect at that point), the intersection is said to have a multiplicity of one. Such
an intersection is also called a transversal intersection, or a simple intersection. When two curves
are tangent, they intersect twice at the point of tangency. They are also said to intersect with
a multiplicity of two. If, in addition, the two curves have the same curvature, they are said to
intersect with a multiplicity three. If two curves intersect with a multiplicity of n and there are no
self-intersections at that point, the two curves are said to be Gn−1 continuous at that point.
Bezout’s theorem also tells us that two surfaces of degree m and n respectively intersect in an
algebraic space curve of degree mn. Also, a space curve of degree m intersects a surface of degree n
in mn points. In fact, this provides us with a useful definition for the degree of a surface or space
curve. The degree of a surface is the number of times it is intersected by a general line, and the
degree of a space curve is the number of times it intersects a general plane. The phrase “number
of intersections” must be modified by the phrase “properly counted”, which means that complex,
infinite, and multiple intersections require special consideration.

7.1.1 Homogeneous coordinates


Proper counting of intersections at infinity is facilitated through the use of homogeneous coordinates.
A planar algebraic curve of degree n
X
f (x, y) = aij xi y j = 0
i+j≤n

79
80 Bezout’s Theorem

can be expressed in homogeneous form by introducing a homogenizing variable w as follows:


X
f (X, Y, W ) = aij X i Y j W k = 0.
i+j+k=n

Note that, in the homogeneous equation, the degree of every term is n.


Any homogeneous triple (X, Y, W ) corresponds to a point whose Cartesian coordinates (x, y) are
(W , W ).
X Y

7.1.2 Circular Points at Infinity


A circle whose equation is (x − xc )2 + (y − yc )2 − r2 = 0 has the homogeneous representation

(X − xc W )2 + (Y − yc W )2 − r2 W 2 = 0. (7.1)

A point whose homogeneous coordinate W = 0 corresponds to a point whose Cartesian coordinates


are at infinity.
An example of the practical use of homogeneous coordinates is that it allows us to observe the
interesting fact that every circle passes through the two points (1, i, 0) and (1, −i, 0). You can easily
verify this by substituting these points into (7.1). The points (1, i, 0) and (1, −i, 0), known as the
circular points at infinity, are both infinite and complex.
Circles are degree two curves, and thus Bezout s theorem requires two distinct circles to intersect
in exactly four points. However, our practical experience with circles suggests that they intersect
in at most two points. Of course, two distinct circles can only intersect in at most two real points.
However, since all circles pass through the two circular points at infinity, we thus account for the
two missing intersection points.

7.1.3 Homogeneous parameters


A unit circle at the origin can be expressed parametrically as

−t2 + 1 2t
x = y = . (7.2)
t2 + 1 t2 + 1

A circle can also be expressed in terms of homogeneous parameters (T, U ) where t = U:


T

−T 2 + U 2 2T U
x = y = . (7.3)
T2 + U2 T2 + U2
To plot the entire circle using equation (7.2), t would have to range from negative to positive infinity.
An advantage to the homogeneous parameters is that the entire circle can be swept out with finite
parameter values. This is done as follows:

• First Quadrant: 0 ≤ T ≤ 1, U = 1

• Second Quadrant: T = 1, 1 ≥ U ≥ 0

• Third Quadrant: T = −1, 0 ≤ U ≤ 1

• Fourth Quadrant: −1 ≤ T ≤ 0, U = 1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
The Intersection of Two Lines 81

7.1.4 The Fundamental Theorem of Algebra


The fundamental theorem of algebra can be thought of as a special case of Bezout’s theorem. It
states that a univariate polynomial of degree n has exactly n roots. That is, for f (t) = a0 + a1 t +
· · · + an tn there exist exactly n values of t for which f (t) = 0, if we count complex roots and possible
multiple roots. If the ai are all real, then any complex roots must occur in conjugate pairs. In other
words, if the complex number b + ci is a root of the real polynomial f (t), then so also is b − ci.

7.2 The Intersection of Two Lines


A line is a degree one curve, so according to Bezout’s theorem, two lines generally intersect in one
point; if they intersect in more than one point, the two lines are identical. Several solutions to the
problem of finding the point at which two lines intersect are presented in junior high school algebra
courses. We present here an elegant solution involving homogeneous representation that is not found
in junior high school algebra courses, and that properly accounts for intersections at infinity.

7.2.1 Homogeneous Points and Lines


We will denote by
P(X, Y, W )
the point whose homogeneous coordinates are (X, Y, W ) and whose Cartesian coordinates are (x, y) =
(X/W, Y /W ). Likewise, we denote by
L(a, b, c)
the line whose equation is ax + by + c = aX + bY + cW = 0.
The projection operator converts a point from homogeneous to Cartesian coordinates: Π(P(X, Y, W )) =
(W
X Y
, W ).
The point P(X, Y, 0) lies at infinity, in the direction (X, Y ). The line L(0, 0, 1) is called the line
at infinite, and it includes all points at infinity.
Since points and lines can both be represented by triples of numbers, we now ask what role is
played by the conventional operations of cross product

(a, b, c) × (d, e, f ) = (bf − ec, dc − af, ae − db)

and dot product


(a, b, c) · (d, e, f ) = ad + be + cf
are defined. The dot product determines incidence: point P(X, Y, W ) lies on a line L(a, b, c) if and
only if
P · L = aX + bY + cW = 0.
The cross product has two applications: The line L containing two points P1 and P2 is given by
L = P1 × P2 and the point P at which two lines L1 and L2 intersect is given by P = L1 × L2 .
This is an example of the principle of duality which, loosely speaking, means that general statements
involving points and lines can be expressed in a reciprocal way. For example, “A unique line passes
through two distinct points” has a dual expression, “A unique point lies at the intersection of two
distinct lines”.
Example The points P(2, 3, 1) and P(3, 1, 1) define a line (2, 3, 1) × (3, 1, 1) = L(2, 1, −7). The
points P(2, 3, 1) and P(1, 4, 1) define a line (2, 3, 1) × (1, 4, 1) = L(−1, −1, 5). The lines L(2, 1, −7)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
82 Intersection of a Parametric Curve and an Implicit Curve

and L(−1, −1, 5) intersect in a point (2, 1, −7) × (−1, −1, 5) = P(−2, −3, −1). Note that Π(2, 3, 1) =
Π(−2, −3, −1) = (2, 3).
We noted that Bezout’s theorem requires that we properly account for complex, infinite, and
multiple intersections, and that homogeneous equations allow us to deal with points at infinity. We
now illustrate. Students in junior high school algebra courses are taught that there is no solution
for two equations representing the intersection of parallel lines, such as

3x + 4y + 2 = 0, 3x + 4y + 3 = 0.

However, using homogeneous representation, we see that the intersection is given by

L(3, 4, 2) × L(3, 4, 3) = P(−4, 3, 0)

which is the point at infinity in the direction (−4, 3).

7.3 Intersection of a Parametric Curve and an Implicit Curve


The points at which a parametric curve (x(t), y(t)) intersects an implicit curve f (x, y) = 0 can be
found as follows. Let g(t) = f (x(t), y(t)). Then the roots of g(t) = 0 are the parameter values at
which the parametric curve intersects the implicit curve. For example, let

x(t) = 2t − 1, y(t) = 8t2 − 9t + 1

and
f (x, y) = x2 + y 2 − 1
Then
g(t) = f (x(t), y(t)) = 64t4 − 144t3 + 101t2 − 22t + 1
The roots of g(t) = 0 are t = 0.06118, t = 0.28147, t = 0.90735, and t = 1.0. The Cartesian
coordinates of the intersection points can then be found by evaluating the parametric curve at those
values of t: (−0.8776, 0.47932), (−0.43706, −0.89943), (0.814696, −0.5799), (1, 0).
If the parametric curve is rational,

a(t) b(t)
x= , y=
c(t) c(t)

it is more simple to work in homogeneous form:

X = a(t), Y = b(t), W = c(t).

For example, to intersect the curves

t2 + t 2t
x= , y=
t2 + 1 t2 + 1
and
f (x, y) = x2 + 2x + y + 1 = 0
we homogenize the implicit curve

f (X, Y, W ) = X 2 + 2XW + Y W + W 2 = 0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Intersection of a Parametric Curve and an Implicit Curve 83

and the parametric curve


X(t) = t2 + t, Y (t) = 2t, W (t) = t2 + 1
and make the substitution
g(t) = f (X(t), Y (t), W (t)) = 4t4 + 6t3 + 5t2 + 4t + 1
In this case, g(t) has two real roots at t = 1 and t = 0.3576 and two complex roots.
This method is very efficient because it reduces the intersection problem to a polynomial root
finding problem. If both curves are parametric, it is possible to convert one of them to implicit
form using implicitization. The implicitization curve intersection algorithm is briefly sketched in
section 17.8. A curve intersection algorithm based on implicitization is very fast, although it has
some limitations. For example, if the degree of the two curves is large, the method is slow and
experiences significant floating point error propagation. For numerical stability, if the computations
are to be performed in floating points, one should implicitize in the Bernstein basis as discussed in
section 17.6. But even this does not adequately reduce floating point error if two two curves are,
say, degree ten.

7.3.1 Order of Contact


Given a degree m parametric curve
P(t) = (X(t), Y (t), W (t))
and a degree n implicit curve
f (X, Y, W ) = 0
the polynomial g(t) = f (X(t), Y (t), W (t)) is degree mn and, according to the fundamental theorem
of algebra, it will have mn roots. This is a substantiation of Bezout’s theorem.
A point on the curve f (X, Y, W ) = 0 is a singular point if fX = fY = fW = 0. A point that is
not singular is called a simple point.
If g(τ ) = 0, then P(τ ) is a point of intersection and g(t) can be factored into g(t) = (1 − τ )k g̃(t)
where k is the order of contact between the two curves. If P(τ ) is a simple point on f (X, Y, W ) = 0,
then the two curves are Gk−1 continuous at P(τ ).
Example The intersection between the line X(t) = −t + 1, Y (t) = t, W (t) = 1 and the curve
X 2 + Y 2 − W 2 = 0 yields g(t) = 2t2 − 2t, so there are two intersections, at t = 0 and t = 1. The
Cartesian coordinates of the intersection points are (1, 0) and (0, 1).
Example The intersection between the line X(t) = 1 + t2 , Y (t) = t, W (t) = 1 and the curve
X + Y 2 − W 2 = 0 yields g(t) = t2 , so there is an intersection at t = 0 with order of contact of 2.
2

These two curves are tangent at (1, 0).


Example The intersection between the line X(t) = 1 − t2 , Y (t) = t + t2 , W (t) = 1 and the
curve X 2 + Y 2 − W 2 = 0 yields g(t) = 4t3 + 3t4 , so there is an intersection at t = 0 with order of
contact of 3, plus an intersection at t = − 34 with order of contact 1. These two curves are curvature
continuous at (1, 0).
The order-of-contact concept gives a powerful way to analyze curvature: The osculating circle is
the unique circle that intersects P(t) with an order of contact of three.
Example f (X, Y, W ) = X 2 + Y 2 − 2ρY W = 0 is a circle of radius ρ with a center at (0, ρ). What
is the curvature of the curve X(t) = x1 t + x2 t2 , Y (t) = y2 t2 , W (t) = w0 + w1 t + w2 t2 ? For these
two curves,
g(t) = (x21 − 2ρw0 y2 )t2 + (2x1 x2 − 2ρw1 y2 )t3 + (x22 − 2ρw2 y2 + y22 )t4

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
84 Computing the Intersection of Two Bézier Curves

For any value of ρ these two curves are tangent continuous. They are curvature continuous if
x21 − 2ρw0 y2 = 0, which happens if
x21
ρ=
2w0 y2
Therefore, the curvature of P(t) at t = 0 is

2w0 y2
κ= .
x21

7.4 Computing the Intersection of Two Bézier Curves


Several algorithms address the problem of computing the points at which two Bézier curves in-
tersect. Predominant approaches are the Bézier subdivision algorithm [LR80], the interval subdi-
vision method adapted by Koparkar and Mudur [KM83], implicitization [SP86a], and Bézier clip-
ping [SN90].

7.4.1 Timing Comparisons


A few sample timing comparisons for these four methods are presented in [SN90]. Comparative
algorithm timings can of course change somewhat as the implementations are fine tuned, if tests are
run on different computers, or even if different compilers are used. These timing tests were run on
a Macintosh II using double precision arithmetic, computing the answers to eight decimal digits of
accuracy.
The columns in Table 7.1 indicate the relative execution time for the algorithms clip = Bézier
clipping algorithm, Impl. = implicitization, Int = Koparkar’s interval algorithm and Sub = the
conventional Bézier subdivision algorithm. In general, the implicitization intersection algorithm is

Example Degree Clip Impl. Int Sub.


1 3 2.5 1 10 15
2 3 1.8 1 5 6
3 5 1 1.7 3 5
4 10 1 na 2 4

Table 7.1: Relative computation times

only reliable for curves of degree up to five using double precision arithmetic. For higher degrees,
it is possible for the polynomial condition to degrade so that no significant digits are obtained in
the answers. For curves of degree less than five, the implicitization algorithm is typically 1-3 times
faster than the Bézier clip algorithm, which in turn is typically 2-10 times faster than the other two
algorithms. For curves of degree higher than four, the Bézier clipping algorithm generally wins.
A brief discussion of these curve intersection methods follows.

7.5 Bézier subdivision


The Bézier subdivision curve intersection algorithm relies on the convex hull property and the de
Casteljau algorithm. Though we overview it in terms of Bézier curves, it will work for any curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Interval subdivision 85

which obeys the convex hull property. Figure 7.1 shows the convex hull of a single Bézier curve, and
the convex hulls after subdividing into two and four pieces.

Figure 7.1: Convex Hulls

The intersection algorithm proceeds by comparing the convex hulls of the two curves. If they
do not overlap, the curves do not intersect. If they do overlap, the curves are subdivided and the
two halves of one curve are checked for overlap against the two halves of the other curve. As this
procedure continues, each iteration rejects regions of curves which do not contain intersection points.
Figure 7.2 shows three iterations.

Figure 7.2: Three iterations of Bézier subdivision

Once a pair of curves has been subdivided enough that they can each be approximated by a line
segment to within a tolerance  (as given in equation 10.4), the intersection of the two approximating
line segments is found.
Since convex hulls are rather expensive to compute and to determine overlap, in practice one
normally just uses the x − y bounding boxes.

7.6 Interval subdivision


The interval subdivision algorithm method is similar in spirit to the Bézier subdivision method. In
this case, each curve is preprocessed to determine its vertical and horizontal tangents, and divided
into “intervals” which have such tangents only at endpoints, if at all. Note that within any such
interval, a rectangle whose diagonal is defined by any two points on the curve completely bounds
the curve between those two endpoints. The power of this method lies in the fact that subdivision
can now be performed by merely evaluating the curve (using Horner’s method instead of the more

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
86 Bézier Clipping method

expensive de Casteljau algorithm) and that the bounding box is trivial to determine. Figure 7.3
illustrates this bounding box strategy.

Figure 7.3: Interval preprocess and subdivision

7.7 Bézier Clipping method


The method of Bézier clipping has many applications, such as ray tracing trimmed rational surface
patches [NSK90], algebraic curve intersection [Sed89], and tangent intersection computation [SN90].
It can be viewed as kind of an interval Newton’s method, because it has quadratic convergence, but
robustly finds all intersections. Since it is such a powerful tool, and since it is based on some ideas
that haven’t been discussed previously in these notes, the majority of this chapter is devoted to this
method.

7.7.1 Fat Lines


Define a fat line as the region between two parallel lines. Our curve intersection algorithm begins by
computing a fat line which bounds one of the two Bézier curves. Similar bounds have been suggested
in references [Bal81, SWZ89].
Denote by L̄ the line P0 − Pn . We choose a fat line parallel to L̄ as shown in Figure 7.4. If L̄ is

d max

d min

_
L

Figure 7.4: Fat line bounding a quartic curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Bézier Clipping method 87

defined in its normalized implicit equation

ax + by + c = 0 (a2 + b2 = 1) (7.4)

then, the distance d(x, y) from any point (x, y) to L̄ is

d(x, y) = ax + by + c (7.5)

Denote by di = d(xi , yi ) the signed distance from control point Pi = (xi , yi ) to L̄. By the convex
hull property, a fat line bounding a given rational Bézier curve with non-negative weights can be
defined as the fat line parallel to L̄ which most tightly encloses the Bézier control points:

{(x, y)|dmin ≤ d(x, y) ≤ dmax } (7.6)

where
dmin = min{d0 , . . . , dn }, dmax = max{d0 , . . . , dn }. (7.7)

7.7.2 Bézier Clipping


Figure 7.5 shows two polynomial cubic Bézier curves P(t) and Q(u), and a fat line L which bounds
Q(u). In this section, we discuss how to identify intervals of t for which P(t) lies outside of L, and
hence for which P(t) does not intersect Q(u).

=1
d min
2
d2=
= -2
d max
3 Q(u)
d3=

-1
d1= -5
d0=
P(t)

Figure 7.5: Bézier curve/fat line intersection

P is defined by its parametric equation


n
X
P(t) = Pi Bin (t) (7.8)
i=0

where Pi = (xi , yi ) are the Bézier control points, and Bin (t) = n
(1 − t)n−i ti denote the Bernstein

i
basis functions. If the line L̄ through Q0 − Qn is defined by

ax + by + c = 0 (a2 + b2 = 1), (7.9)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
88 Bézier Clipping method

then the distance d(t) from any point P(t) to L̄ can be found by substituting equation 7.8 into
equation 7.9:
Xn
d(t) = di Bin (t), di = axi + byi + c. (7.10)
i=0

Note that d(t) = 0 for all values of t at which P intersects L̄. Also, di is the distance from Pi to L̄
(as shown in Figure 7.5).
The function d(t) is a polynomial in Bernstein form, and can be represented as an explicit Bézier
curve (Section 2.14) as follows:
n
X
D(t) = (t, d(t)) = Di Bin (t). (7.11)
i=0

Figure 7.6 shows the curve D(t) which corresponds to Figure 7.5.

d (1,3)
2
( ,2)
3
1
0 t
( 13 ,-1)
-2

(0,-5)
t=0.25 t=0.75

Figure 7.6: Explicit Bézier curve

Values of t for which P(t) lies outside of L correspond to values of t for which D(t) lies above
d = dmax or below d = dmin . We can identify parameter ranges of t for which P(t) is guaranteed
to lie outside of L by identifying ranges of t for which the convex hull of D(t) lies above d = dmax
or below d = dmin . In this example, we are assured that P(t) lies outside of L for parameter values
t < 0.25 and for t > 0.75.
Bézier clipping is completed by subdividing P twice using the de Casteljau algorithm, such that
portions of P over parameter values t < 0.25 and t > 0.75 are removed.
Figure 7.6 shows how to clip against a fat line using a single explicit Bézier curve. This approach
only works for polynomial Bézier curves. For rational Bézier curves, the explicit Bézier curves
generated for each of the two lines are not simple translations of each other, so we must clip against
each of the two lines separately. This is illustrated in Sections 7.7.7 and 7.7.8

7.7.3 Iterating
We have just discussed the notion of Bézier clipping in the context of curve intersection: regions
of one curve which are guaranteed to not intersect a second curve can be identified and subdivided

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Bézier Clipping method 89

away. Our Bézier clipping curve intersection algorithm proceeds by iteratively applying the Bézier
clipping procedure.
Figure 7.7 shows curves P(t) and Q(u) from Figure 7.5 after the first Bézier clipping step in
which regions t < 0.25 and t > 0.75 have been clipped away from P(t). The clipped portions of P(t)
are shown in fine pen width, and a fat line is shown which bounds P(t), 0.25 ≤ t ≤ 0.75. The next
step in the curve intersection algorithm is to perform a Bézier clip of Q(u), clipping away regions
of Q(u) which are guaranteed to lie outside the fat line bounding P(t). Proceeding as before, we

P(t)

Q(u)

Figure 7.7: After first Bézier clip

define an explicit Bézier curve which expresses the distance from L̄ in Figure 7.7 to the curve Q(u),
from which we conclude that it is safe to clip off regions of Q(u) for which u < .42 and u > .63.
Next, P(t) is again clipped against Q(u), and so forth. After three Bézier clips on each curve,
the intersection is computed to within six digits of accuracy (see Table 7.2).

Step tmin tmax umin umax


0 0 1 0 1
1 0.25 0.75 0.4188 0.6303
2 0.3747 0.4105 0.5121 0.5143
3 0.382079 0.382079 0.512967 0.512967

Table 7.2: Parameter ranges for P(t) and Q(u).

7.7.4 Clipping to other fat lines


The fat line defined in section 7.7.1 provides a nearly optimal Bézier clip in most cases, especially
after a few iterations. However, it is clear that any pair of parallel lines which bound the curve can
serve as a fatline. In some cases, a fat line perpendicular to line P0 − Pn provides a larger Bézier
clip than the fat line parallel to line P0 − Pn . We suggest that in general it works best to examine
both fat lines to determine which one provides the largest clip. Experience has shown this extra
overhead to reap a slightly lower average execution time.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
90 Bézier Clipping method

7.7.5 Multiple Intersections


Figure 7.8 shows a case where two intersection points exist. In such cases, iterated Bézier clipping

Figure 7.8: Two intersections

cannot converge to a single intersection point. The remedy is to split one of the curves in half and
to compute the intersections of each half with the other curve, as suggested in Figure 7.9. A stack

Figure 7.9: Two intersections, after a split

data structure is used to store pairs of curve segments, as in the conventional divide-and-conquer
intersection algorithm [LR80].
Experimentation suggests the following heuristic. If a Bézier clip fails to reduce the parameter
range of either curve by at least 20%, subdivide the “longest” curve (largest remaining parameter
interval) and intersect the shorter curve respectively with the two halves of the longer curve. This
heuristic, applied recursively if needed, allows computation of arbitrary numbers of intersections.

7.7.6 Rational Curves


If P is a rational Bézier curve Pn
i=0 wi Pi Bi (t)
n
P(t) = P n (7.12)
i=0 wi Bi (t)
n

with control point coordinates Pi = (xi , yi ) and corresponding non-negative weights wi , the Bézier
clip computation is modified as follows. Substituting equation 7.12 into equation 7.9 and clearing
the denominator yields:
n
X
d(t) = di Bin (t), di = wi (axi + byi + c).
i=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Bézier Clipping method 91

The equation d(t) = 0 expresses the intersection of P(t) with a line ax + by + c = 0. However, unlike
the non-rational case, the intersection of P(t) with a fat line cannot be represented as {(x, y) =
P(t)|dmin ≤ d(t) ≤ dmax }. Instead, P must be clipped independently against each of the two lines
bounding the fat line. Thus, we identify ranges of t for which
n
X
wi (axi + byi + c − dmax )Bin (t) > 0
i=0

or for which
n
X
wi (axi + byi + c + dmin )Bin (t) < 0.
i=0

These ranges are identified using the Bézier clipping technique as previously outlined.

7.7.7 Example of Finding a Fat Line


We now run through an example of how to compute a fat line and perform a Bézier clip on a pair
of rational Bézier curves. We use the notation for points and lines as triple of numbers, presented
in Section 7.2. This leads to an elegant solution.
Figure 7.10.a shows a rational Bézier curve of degree n = 4. The control points are written in
homogeneous form: Pi = wi ∗ (xi , yi , 1). For example, the notation P1 = 3 ∗ (4, 6, 1) means that the
Cartesian coordinates are (4, 6) and the weight is 3.

P4=(10,9,1)

P1=3*(4,6,1)

L1=(-6,8,-24)

P =(2,3,1)
0
_ _
L =P0XP4=(-6,8,-12) L =P0XP4=(-6,8,-12)

(a) Rational Bézier Curve. Line L̄ = P0 × P4 . (b) Line L1 .

P2=(4,8,1)

L2=(-6,8,-40)

P3=4*(8,5,1)
_
L =(-6,8,-12) L3=(-6,8,8)
_
L =P0XP4=(-6,8,-12)

(c) Line L1 . (d) Line L1 .

Figure 7.10: Example of how to find fat lines.

To compute a fat line that bounds this curve, begin by computing the base line L̄ = P0 × Pn =
(−6, 8, −12). Then, compute the lines Li , i = 1, . . . , n − 1 that are parallel to L̄ and that pass
through Pi . In general, if L̄ = (a, b, c), then Li = (a, b, ci ). Thus, we must solve for ci such that

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
92 Bézier Clipping method

(a, b, ci ) · Pi = 0. Thus,
ci = −axi − byi .
Call the line with the smallest value of ci Lmin and the line with the largest value of ci Lmax .
We want the curve to lie in the positive half space of each bounding line. It can be shown that this
will happen if we scale Lmin by −1.
Thus, in our example, we have

Lmin = −L2 = (6, −8, 40), Lmax = L3 = (−6, 8, 8). (7.13)

7.7.8 Example of Clipping to a Fat Line

E4

L04 L03
P1=1*(0,12,1)

P2=2*(5,10,1)
P0=1*(0,10,1)
E3
L02
P3=3*(8,7,1) V4 V3 V2
X=L(0,1,0)
E2
E0
E1
Lmin=(6,-8,40) Lmax=(-6,8,8) L01
P4=3*(11,1,1)
(a) Curve and fat line. (b) Explicit Bézier Curve for Clipping against Lmin .

Figure 7.11: Clipping to a fat line.

Figure 7.11.a shows a rational Bézier curve to be clipped against the fat line (7.13). Figure 7.11.b
shows the resulting explicit Bézier curve where

i
Ei = ( , Lmin · Pi , 1).
n
In this example,
1 1 3
E0 = (0, −40, 1), E1 = ( , −56, 1), E2 = ( , −20, 1), E3 = ( , 96, 1), E4 = (1, 294, 1)
4 2 4
Note that we only want to clip away the portions of P(t) that lie in the negative half space of
Lmin . That half space corresponds to the values of t for which the explicit curve is < 0. Therefore,
we can clip away the “left” portion of the curve if and only if E0 lies below the x-axis and we can
clip away the “right” portion of the curve if and only if En lies below the x-axis. So in this example,
we can compute a clip value at the “left” end of the curve, but not the “right” end.
To compute the clip value, we first compute the lines

L0,i = E0 × Ei

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Bézier Clipping method 93

and the points


L0,i × X = Vi = (ai , 0, ci )
where X = (0, 1, 0) is the line corresponding to the x-axis (y = 0). In our example,
1 1 3
L01 = (16, , 10), L02 = (−20, , 20), L03 = (−136, , 30), L04 = (−334, 1, 40)
4 2 4
and

V1 = (−10, 0, 16), V2 = (−20, 0, −20), V3 = (−30, 0, −136), V4 = (−40, 0, −334).

Our “clip” value will be the x-coordinate of the left-most Vi that is to the right of the origin. To
determine this, we must project the homogeneous points Vi to their corresponding Cartesian points
vi which yields:
5 30 40
v1 = (− , 0), v2 = (1, 0), v3 = ( , 0) ≈ (.2206, 0), v4 = ( , 0) ≈ (.1198, 0).
8 136 334
So the desired t value at which to clip against Lmin is .1198, and we can eliminate the domain
t ∈ [0, 0.1198).
We now clip against line Lmax . The explicit Bézier curve is shown in Figure 7.12, for which
i
Ei = ( , Lmax · Pi , 1).
n
In this example,
1 1 3
E0 = (0, 88, 1), E1 = ( , 104, 1), E2 = ( , 116, 1), E3 = ( , 48, 1), E4 = (1, −150, 1)
4 2 4

L42 L43
E1 E2
E0 E3
V0 V3 X=L(0,1,0)
L40
E4

Figure 7.12: Clipping to Lmax .

Since E0 is above the x-axis and E4 is below the x-axis, we can clip the right side of the curve
but not the left. We have
3 1 1
L40 = (−238, −1, 88), L41 = (−254, − , 141.5), L42 = (−266, − , 191), L43 = (−198, − , 160.5)
4 2 4
and

V0 = (−88, 0, −238), V1 = (−141.5, 0, −254), V2 = (−191, 0, −266), V3 = (−160.5, 0, −198).

Projecting the homogeneous points Vi to their corresponding Cartesian points vi yields

v0 ≈ (.3697, 0), v1 ≈ (.5571, 0), v2 ≈ (.7180, 0), v3 ≈ (.8106, 0).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
94 Bézier Clipping method

V1 H E4

E1

E0

Figure 7.13: Clipping example.

When clipping away the right end of the curve, we need to identify the right-most Vi that is to the
left of (1, 0), which in this example is V3 . Thus, we can clip away t ∈ (.8106, 1].
Note that we are not computing the exact intersection between the convex hull and the x-axis,
as illustrated in Figure 7.13, where the algorithm described in this section would compute a clip
value corresponding to V1 , whereas the convex hull crosses the x-axis at H. In our experiments, the
method described here runs faster than the method where we compute the exact intersection with
the convex hull because in most cases the two values are the same and the method described here is
more simple.

E0
E2 E4
E3 E2
E1 V01 V34
E4 E1 E3
E1
E3
E0 E4
E2 E0

(a) Clip away everything. (b) Clip away nothing. (c) Clip to the left of V01 and to
the right of V34 .

Figure 7.14: Additional examples.

A few additional examples are illustrated in Figure 7.14. In Figure 7.14.a, all control points lie
below the x-axis. In this case, there is no intersection. In Figure 7.14.b, E0 and En lie above the
x-axis. In this case, no clipping is performed. In Figure 7.14.c, clipping values are computed for
both the left and right sides of the curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 8

Offset Curves

An offset curve is the set of all points that lie a perpendicular distance ρ from a given curve in R2 .
The scalar ρ is called the offset radius. If the parametric equation of the given curve is
P(t) = (x(t), y(t)) (8.1)
then the offset curve with offset radius ρ is given by
(y 0 (t), −x0 (t))
Ω(ρ, P(t)) = P(t) + ρ p (8.2)
x02 (t) + y 02 (t)
Note that in this definition, if ρ is positive, the offset is on our right as we walk along the base curve
in the direction of increasing parameter value.

(a) Offsets of a convex curve. (b) Offset of a curve that has an inflection point.

Figure 8.1: Offset Curves.

In Figure 8.1, the red curves are offsets of the black curves.
Offset curves play an important roll in computer aided design and manufacturing (CAD/CAM).
If a numerically controlled machine is used to cut out a shape, the cutting tool has a finite radius.

95
96

Therefore, the path that the tool traverses is an offset curve and the offset radius is the radius of
the cutting tool.
It is important that the tool radius is less than the minimum radius of curvature of the curve,
otherwise the tool will perform unintended gouging. Figure 8.2 illustrates an offset curve whose
radius exceeds the radius of curvature along part of the base curve. Every point at which the radius
of curvature in the base curve matches the offset radius creates a cusp in the offset curve. At the
cusp, the offset curve changes direction. Between cusps, the first derivative vectors of the base curve
and offset curve point in opposite directions.

(a) Offsets of a convex curve. (b) Offset of a curve that has an inflection point.

Figure 8.2: Offset Curves in which the Offset Radius Exceeds the Radius of Curvature for a Portion
of the Base Curve.

If P is an offset of Q, the reverse is generally true, as long as the offset radius is everywhere less
than the radius of curvature of both curve segments:

Ω(−ρ, Ω(ρ, P(t))) = P(t). (8.3)

Ini general, offset curves cannot be represented in Bézier form because (8.2) contains a square
root of a polynomial. The obvious exceptions are circles and straight lines. A non-obvious exception
is that the offset of any parabola can be represented as a degree eight rational Bézier curve.
In addition, a family of curves has been identified by Rida Farouki which can be represented in
rational Bézier form. There curves are called Pythagorean Hodograph curves, and they defined by
the property that the sum x02 (t) + y 02 (t) is a perfect square of a polynomial. Farouki has written
many papers on this subject that detail some elegant geometric properties that can be imposed
on the control polygon of a Bézier curve to assure that it satisfies the Pythagorean Hodograph
requirement.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 9

Polynomial Root Finding in


Bernstein Form

The Bernstein polynomial basis enjoys widespread use in the fields of CAGD and computer graphics.
The use of the Bernstein basis functions to express Bézier curves and surfaces allows many basic
algorithms concerned with the processing of such forms to be reduced to the problem of computing
the real roots of polynomials in Bernstein form.
A typical example is the problem of computing the intersection points of two Bézier curves using
the implicitization algorithm. Given two curves of degrees m and n, respectively, the problem of
identifying their intersection points can be reformulated in terms of finding the real roots on the
unit interval of a degree mn polynomial in Bernstein form [SP86a]. Other examples from CAGD
include finding a point on each loop of the intersection curve of two surfaces and the “trimming”
of offset and bisector curves. Examples from computer graphics include ray tracing and algebraic
surface rendering.
In the early years of computer graphics and CAGD, the tendency was to convert from the
Bernstein to the power basis for root finding since the power basis is more “familiar” and library
routines are commonly available to solve for polynomial roots in the power basis. However, it has
subsequently been demonstrated [FR87] that the Bernstein basis is inherently better conditioned
than the power basis for finding real roots on the unit interval (and this is all that is of interest when
dealing with Bézier curves anyway). Thus, root finding algorithms for polynomials in Bernstein form
are not merely a convenience, they in fact offer significantly better accuracy than their power basis
counterparts.
Furthermore, by expressing Bernstein form polynomials as explicit Bézier curves, one can take
advantage of geometric insights based on the control polygon in developing root–finding algorithms.
This can allow us to robustly find all real roots in the unit interval, typically much faster than can
a library polynomial root finder which finds all real and complex roots. Thus, a root finder that
works in the Bernstein basis could provide enhanced speed and accuracy when applied to problems
whose solution traditionally relies on the computation of real polynomial roots in the power basis.
A detailed study of root finding algorithms for polynomials in Bernstein form is found in [Spe94].
In this chapter we review two basic approaches. The fundamental idea it to express a polynomial
as an explicit Bézier curve (Section 2.14).

97
98 Convex Hull Marching

9.1 Convex Hull Marching

The Bernstein convex hull approximating step algorithm finds each real root of [0, 1] in ascending
order by computing a sequence of subdivided explicit Bézier curves which are guaranteed to not skip
over a real root. Each step is determined by exploiting the convex hull property which assures that
all roots lie within the interval where the convex hull of the control polygon intersects the t-axis. A
root is realized when its respective sequence of approximating steps converge to a limit.

This algorithm is quite similar to Newton’s method, but it has the advantage that it always
approaches the root from the left, and hence it cannot diverge like Newton’s method.

This algorithm was first overviewed in [SP86a]. Since then, it has been adopted to various
applications and to higher dimensions under a technique referred to as Bézier clipping [SWZ89,
Sed89, SN90, NSK90].

The algorithm is illustrated in Figure 9.1. Begin by determining the left-most intersection be-
tween the convex-hull of the explicit Bézier curve f[0,1] (t). and the t axis. No roots can exist in
the interval [0, t1 ] in Figure 9.1.a. Next, perform the de Casteljau algorithm (Figure 9.1.b) yielding
f[t1 ,1] (t) and find the value t2 where the new convex hull intersects the t axis. These two operations
are repeated until tk+1 = tk to within floating point tolerance, and tk is taken to be a root. In this
case, k = 6. To within floating point tolerance, f0 = 0 in the explicit Bézier curve f[t6 ,1] (t).

One pitfall to be aware of is that, due to floating point roundoff, it is possible (although rare) for
the algorithm to sneak past a root. To avoid this problem, you should check to make sure that, at
each iteration, f[ti ,1] (ti ) and f[ti+1 ,1] (ti+1 ) have the same sign. If they do not, ti and ti+1 will differ
only by floating point error. You should take f[ti ,1] (ti ) to have a root at ti and proceed with the
deflation step.

When a root is found, it is “deflated” out and the algorithm proceeds as before to find the next
root. Deflation is the process of finding a degree n − 1 polynomial f[t1k ,1] (t)which has the same roots
as f[tk ,1] (t) except for the root at tk . If we denote the deflated polynomial by f[t1k ,1] (t), then

f[tk ,1] (t) = (t − tk )f[t1k ,1] (t).

The coefficients of f[t1k ,1] (t) are

n
yi1 = yi+1 , i = 0, . . . , n − 1.
i+1

This can be seen from the following derivation:

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Bernstein Combined Subdivide & Derivative Algorithm 99

n
X
f[0,1] (t) = yi Bin (t)
i=1
n  
X n
= yi (1 − t)n−i ti
i=1
i
n−1  
X n
= t yi+1 (1 − t)n−1−i ti
i=0
i + 1
n−1 n

X i+1
= t n−1 yi+1 Bi
 n−1

i=0 i
n−1
X n
= t yi+1 Bin−1
i=0
i+1
(9.1)

This algorithm performs reliably. It is numerically stable. The main drawback is the expense of
doing a de Casteljau subdivision at each step.

9.2 Bernstein Combined Subdivide & Derivative Algorithm


In general, the most efficient root finding algorithm for polynomials of degree larger than seven is
one which isolates roots and then refines them using the modified regula falsi method. A root is
isolated if there is exactly one sign change in the Bernstein coefficients (this is due to the variation
diminishing property).
The root isolation heuristic is illustrated in Figures 9.2 and 9.3. The basic idea is to perform
a binary search to isolate the left-most root. If the root is not isloated after a few de Casteljau
subdivisions (first at t=.5, then t=.25, then t=.125), the algorithm computes the left-most root of
the derivative polynomial and uses that value to isolate the left-most root of the polynomial.
Figure 9.2.a shows an initial degree five polynomial with simple roots at 0, 0.2, and 1, along
with a double root at 0.6. Figure 9.2.b shows the polynomial after deflating the roots at 0 and
(2)
1. In Figure 9.2.c, the polynomial has been split in two pieces at τ1 and the segment P[0,τ1 ] (t) is
determined to contain exactly one root since its control polygon crosses the t axis exactly once. In
(3)
Figure 9.2.d, P[τ1 ,1] (t) does not pass the isolation test because its control polygon crosses the t axis
twice.
(3)
In Figure 9.3.e, P[τ1 ,1] (t) is split and the right half is seen to have no roots, while the left half is
indeterminate. Figure 9.3.f performs another subdivision, with the same results, as does Figure 9.3.g.
At this point, the algorithm changes its heuristic for isolating the root from binary search to finding
the left–most root of the derivative of P(6) (t). That derivative, shown in Figure 9.3.h, has only one
root in the interval. The root is refined and used to isolate the left–most root of P(6) (t). In this
case, the double root at 0.6 is identified by checking that the numerical value of P(6) (0.6) is less
than the computed running error bound.
This algorithm is generally faster than the one in Section 9.1 because the modified regula falsi
refinement algorithm can be preformed using the O(n) Horner’s evaluation algorithm instead of the
O(n2 ) de Casteljau algorithm.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
100 Bernstein Combined Subdivide & Derivative Algorithm

f[0,1](t)
(a) 0 1
t1

f[t1,1](t)
(b) 0 1
t2

f[t2,1](t)
(c) 0 1

. . . After 4 more iterations,


progress stops
f[t7,1](t)
(d) 0 1

t6 = t7

Deflate the root


f1[t7,1](t)
(e) 0 1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014

Figure 9.1: Bernstein root finding


Bernstein Combined Subdivide & Derivative Algorithm 101

(a)

(0)
P[0,1] (t)
t
0.2 0.4 0.6 0.8 1.0

(b)
(1)
P[0,1] (t) t
0.2 0.4 0.6 0.8 1.0

(c)
(2)
P[0,τ1](t) t
0.2 0.4 0.6 0.8 1.0

(d)
(3)
P[τ1,1](t) t
0.2 0.4 0.6 0.8 1.0

Figure 9.2: Root isolation heuristic (a-d).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
102 Bernstein Combined Subdivide & Derivative Algorithm

P (4)(t) t
(e)
0.2 0.4 0.6 0.8 1.0

P (5)(t)
t
(f) 0.2 0.4 0.6 0.8 1.0

P (6)(t)
t
(g) 0.2 0.4 0.6 0.8 1.0

P ’(t)
t
(h) 0.2 0.4 0.6 0.8 1.0

Figure 9.3: Root isolation heuristic (e-h).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Multiplication of Polynomials in Bernstein Form 103

9.3 Multiplication of Polynomials in Bernstein Form


Given
m
X n
X
f (t) = fi Bim (t), and g(t) = gi Bin (t)
i=0 i=0

their product h(t) = f (t)g(t) is a polynomial in Bernstein form of degree m + n whose coefficients
are
m
P  n
i+j=k i fi j gj
hk = m+n

k

The notation means to use all valid values of i and j that add up to k. Denote
P
i+j=k

m
X
hf0 , f1 , . . . , fm im (t) = fi Bim (t).
i=0

Then, for example,

hf0 , f1 , f2 i2 (t) × hg0 , g1 , g2 , g3 i3 (t) =


3f0 g1 + 2f1 g0 3f0 g2 + 6f1 g1 + f2 g0 f0 g3 + 6f1 g2 + 3f2 g1 2f1 g3 + 3f2 g2
hf0 g0 , , , , , f2 g3 i
5 10 10 5
The binomial coefficients ni can be computed using the recurrence relation


n−i+1
   
n n
= .
i i i−1

Thus, n0 = 1, n1 = n, n2 = n−1 1 , etc.


n
   
2

9.4 Intersection between a Line and a Rational Bézier Curve


The points of intersection between a rational Bézier curve
Pn
i=0 wi Pi Bi (t)
n
P(t) = P n
i=0 wi Bi (t)
n

and a line
ax + by + cw = 0
can be computed by substituting the parametric equation of the curve into the implicit equation of
the line, producing a polynomial in Bernstein form
n
X
f (t) = fi Bin (t), fi = axi wi + byi wi + cwi .
i=0

The roots of f (t) give the parameter values of the points at which the curve intersects the line.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
104 Intersection between a Line and a Rational Bézier Curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 10

Polynomial Interpolation

10.1 Undetermined Coefficients


The method of undetermined coefficients provides a solution to the problem of finding a parametric
curve which passes through a set of points. For example, suppose we wish to find a cubic parametric
curve which passes through the points (0,0), (2,2), (0,3), and (2,4). We must first specify at what
parameter value the curve will interpolate each point. Lets say we want (0,0) to have a parameter
value of 0, (2,2) is to have a parameter value of 1/4, (0,3) should correspond to parameter t = 3/4,
and (2,4) should have a parameter value of 1.

(2,4)
t=1
(0, 3)
t = 3/4
(2, 2)
t = 1/4

(0, 0)
t 0
Figure 10.1: Interpolating Four Points

We can now pick any form we wish for the parametric equations. Let’s first see how it is done
for standard power basis polynomials, and then we will solve the same problem using Bernstein
polynomials. For power basis polynomials, the parametric equations are of the form
x = a0 + a1 t + a2 t2 + a3 t3

105
106 Undetermined Coefficients

y = b0 + b1 t + b2 t2 + b3 t3
To solve for the ai , we set up four linear equations:

0 = a0 + a1 0 + a2 02 + a3 03

1 1 1
2 = a0 + a1 ( ) + a2 ( )2 + a3 ( )3
4 4 4
3 3 2 3
0 = a0 + a1 ( ) + a2 ( ) + a3 ( )3
4 4 4
2 = a0 + a1 1 + a2 12 + a3 13
In matrix form, we have

1 0 0 0 0 
    
 a0  
 1 1
( 14 )2 ( 41 )3  2
   

a1
  
4 = .
 1 ( 34 )2 ( 43 )3   0 
 3

4 a2  
1 1 1 1 2
   

a3
  

from which
x = 18t − 48t2 + 32t3
Likewise for y, we solve the set of equations

1 0 0 0 0
    
 b0   
 1 1 ( 1 )2 ( 1 )3 2
   
  b1   
4 4 4 = .
 1 3 ( 3 )2 ( 3 )3 3
 
  b2 
4 4 4  
1 1 1 1 4
   
b3
   

and we solve for


56 2 32 3
y = 12t − t + t .
3 3
Let’s next look at how we could solve directly for the Bézier control points of a Bézier curve
which interpolates those same points at those same parameter values. The only difference between
this problem and the one we just solved is the form of the polynomial. In this case, we want to solve
for the coefficients of a Bernstein polynomial:

x = a0 (1 − t)3 + 3a1 t(1 − t)2 + 3a2 t2 (1 − t) + a3 t3 .

We evaluate this expression at x = 0, t = 0, again at x = 2, t = 41 , again at x = 0, t = 3


4 and again
at x = 2, t = 1 to produce a set of equations:

0 = a0 (1 − 0)3 + 3a1 0(1 − 0)2 + 3a2 02 (1 − 0) + a3 03 .

1 1 1 12 1 13
2 = a0 (1 − )3 + 3a1 (1 − )2 + 3a2 (1 − ) + a3 .
4 4 4 4 4 4
3 3 3 32 3 33
0 = a0 (1 − )3 + 3a1 (1 − )2 + 3a2 (1 − ) + a3 .
4 4 4 4 4 4
2 = a0 (1 − 1)3 + 3a1 1(1 − 1)2 + 3a2 12 (1 − 1) + a3 13 .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Lagrange Interpolation 107

In matrix form, we have

1 0 0 0 0
    
 a0   
27 27 9 1 
2
   
a1
  
=

64 64 64 64  .
0
 1 9 27 27 

64 64 64 64  a2   
0 0 0 1 2
   
a3
   

The x coordinates ai of the Bézier control points work out to be a0 = 0, a1 = 6, a2 = − 4,


and a3 = 2. We can perform a similar computation to compute the y coordinates of the Bézier
control points. They work out to be 0, 4, 169 , and 4.

P3= (2, 4) P1= (6, 4)

P2 = (-4, 16/9)

P0= (0, 0)

Figure 10.2: Interpolating Four Points

10.2 Lagrange Interpolation


There exists a clever set of basis polynomials which enable us to interpolate a set of points without
having to solve a set of linear equations. These are known as Lagrange polynomials and are denoted
Lni (t). The purpose of Lagrange polynomials is to enable us, with virtually no computation, to find
a degree n parametric curve which interpolates n + 1 points P0 , P1 , ... , Pn at parameter values
t0 , t1 , ..., tn . The curve is defined by

P(t) = P0 Ln0 (t) + P1 Ln1 (t) + ... + Pn Lnn (t).

Note the following about the Lni (t): Lni (tj ) = 1 whenever i = j and Lni (tj ) = 0 whenever i 6= j.
This must be so in order for the curve to interpolate point Pi at parameter value ti . You can easily
verify that the following choice for Lni (t) satisfies those conditions:

(t − t0 )(t − t1 ) ... (t − ti−1 )(t − ti+1 ) ... (t − tn )


Lni (t) =
(ti − t0 )(ti − t1 ) ... (ti − ti−1 )(ti − ti+1 ) ... (ti − tn )

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
108 Newton Polynomials

or
Lni (t) =
n
Y (t − tj )
, j 6= i
(t
j=0 i
− tj )

In the example from the previous section, we have

(t − 14 )(t − 43 )(t − 1) 16 1 3
L30 (t) = = − (t − )(t − )(t − 1)
(0 − 4 )(0 − 4 )(0 − 1)
1 3 3 4 4

(t − 0)(t − 43 )(t − 1) 32 3
L31 (t) = = t(t − )(t − 1)
( 14 − 0)( 14 − 43 )( 14 − 1) 3 4

(t − 0)(t − 41 )(t − 1) 32 1
L32 (t) = = − t(t − )(t − 1)
( 4 − 0)( 4 − 4 )( 4 − 1)
3 3 1 3 3 4

(t − 0)(t − 41 )(t − 34 ) 16 1 3
L33 (t) = = t(t − )(t − )
(1 − 0)(1 − 14 )(1 − 34 ) 3 4 4
The interpolating curve is thus  
x(t)
P(t) = =
y(t)
0 2 0 2
       
L30 (t) + L31 (t) + L32 (t) + L33 (t)
0 2 3 4
If this expression is expanded out, it is seen to be identical to the equation we obtained using the
method of undetermined coefficients.
It can be shown that the Lagrange blending functions are coordinate system independent, but
do not obey the convex-hull property.

10.3 Newton Polynomials


Newton polynomials provide an additional method for finding a degree-n polynomial p(t) that in-
terpolates n + 1 points:
p(ti ) = yi , i = 0, . . . , n.
Newton polynomials are defined
p0 (t) = a0
p1 (t) = a0 + a1 (t − t0 )
p2 (t) = a0 + a1 (t − t0 ) + a2 (t − t0 )(t − t1 ) ...
pn (t) = pn−1 (t) + an (t − t0 )(t − t1 ) · · · (t − tn−1 ).
The coefficients ai can be computed using divided differences, which can be found using a table
that is reminiscent of forward differences. The notation for a divided difference is fi,...,k , and the
coefficients ai turn out to be:

a 0 = f0 , a1 = f0,1 , a2 = f0,1,2 , . . . , an = f0,1,...,n .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Newton Polynomials 109

The divided differences are computed using a recurrence relation:

fi = yi

fi+1 − fi
fi,i+1 =
ti+1 − ti
fi+1,...,k − fi,...,k−1
fi,...,k =
tk − ti
These divided differences are easily calculated by means of a divided difference table:

t0 y0 = f0
t1 y1 = f1 f0,1
t2 y2 = f2 f1,2 f0,1,2
t3 y3 = f3 f2,3 f1,2,3 f0,1,2,3
.. .. .. .. .. ..
. . . . . .
tn yn = fn fn−1,n ··· ··· ··· f0,1,...n

Example
A polynomial parametric curve P(t) of degree three satisfies the following conditions:

t0 = 0; P0 = (0, 0); t1 = 1, P1 = (3, 3); t2 = 3, P2 = (5, 3); t3 = 4, P3 = (7, 0).

Express P(t) using Newton polynomials and compute P(2).

Setting up the divided difference table:

0 (0, 0)
1 (3, 3) (3, 3)
3 (5, 3) (1, 0) (− 23 , −1)
4 (7, 0) (2, −3) ( 13 , −1) ( 41 , 0)

from which
2 1
P(t) = (0, 0) + (3, 3)(t − 0) + (− , −1)(t − 0)(t − 1) + ( , 0)(t − 0)(t − 1)(t − 3)
3 4
from which
25
P(2) = (
, 4).
6
The divided difference table is similar to forward differencing. However, with forward differencing, it
is only possible to evaluate a polynomial at evenly spaced parameter values, whereas with a divided
difference table, you can evaluate the polynomial at any parameter value. We can also evaluate a
polynomial directly from the divided difference table (in a manner similar to forward differencing),
but it is more expensive than forward differencing.

Example A polynomial parametric curve P(t) of degree three satisfies the following conditions:

t0 = 0; P0 = (0, 0); t1 = 1, P1 = (3, 3, ); t2 = 3, P2 = (5, 3); t3 = 4, P3 = (7, 0).

Compute P(2) directly from the divided difference table.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
110 Neville’s Scheme

Solution
Since this is a degree-three polynomial, the third column in the divided difference table is constant.
We add another row to the divided difference table, place 2 (the desired parameter value) in column
1, copy the value of the third column, then solve for c0 , then c1 , then c2 .
0 (0, 0)
1 (3, 3) (3, 3)
3 (5, 3) (1, 0) (− 23 , −1)
4 (7, 0) (2, −3) ( 13 , −1) ( 41 , 0)
2 c2 c1 c0 ( 14 , 0)
To find c0 , we set up the divided difference equation
( 13 , −1) − c0 1
= ( , 0)
1−2 4
from which c0 = ( 12
7
, −1). To find c1 , we set up the divided difference equation
(2, −3) − c1
= c0
3−2
from which c1 = ( 12
17
, −2). To find c2 , we set up the divided difference equation
(7, 0) − c2
= c1
4−2

6 , 4).
from which c2 = ( 25

10.4 Neville’s Scheme


Neville’s scheme addresses the problem: Given a set of n + 1 points and a parameter value assigned
to each point
p(ti ) = pi , i = 0, . . . , n.
find the point p(t) for any other point on the unique degree n polynomial curve that interpolates
those points. Note that while Lagrange and Newton polynomials give us an actual curve equation,
Neville’s scheme provides us with a geometric construction for finding any point on the curve, without
formally using an equation for the curve.
Neville’s scheme is based on Aitken’s Lemma. Denote by pi,...k (t) the degree k − 1 polynomial
curve that interpolates points pi , . . . pk . Aitken’s Lemma states:
(tk − t)pi,...,k−1 (t) − (ti − t)pi+1,...,k (t)
pi,...,k (t) = .
tk − ti
Neville’s scheme applies Aitken’s Lemma as follows. Suppose we wish to find the point p(τ ). Begin
by labeling the interpolated points as p0 , . . . pn . Then compute the n points
(ti+1 − t)pi − (ti − t)pi+1
pi,i+1 (τ ) = , i = 0, . . . , n − 1.
ti+1 − ti
Next compute the n − 1 points
(ti+2 − t)pi,i+1 (τ ) − (ti − t)pi+1,i+2 (τ )
pi,i+1,i+2 (τ ) = , i = 0, . . . , n − 2.
ti+2 − ti

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Comparison 111

Then likewise compute the n − 2 points pi,i+1,i+2,i+3 (τ ) and so forth until pi,...,n (τ ) = p(τ ) is
computed. A key concept here is that pi,...k (t) is the curve that interpolates Pi . . . Pk , and
therefore pi,...k (τ ) is the point on that curve corresponding to t = τ .

Example A polynomial parametric curve P(t) of degree three satisfies the following conditions:

t0 = 0; P0 = (0, 0); t1 = 1, P1 = (3, 3, ); t2 = 3, P2 = (5, 3); t3 = 4, P3 = (7, 0).

Find P(2).

We first compute
(t1 − 2)P0 + (2 − t0 )P1 (1 − 2)P0 + (2 − 0)P1
P01 (2) = = = (6, 6);
1−0 1−0
(t2 − 2)P1 + (2 − t1 )P2 (3 − 2)P1 + (2 − 1)P2
P12 (2) = = = (4, 3);
t2 − t1 2
(t3 − 2)P2 + (2 − t2 )P3 (4 − 2)P2 + (2 − 3)P3
P23 (2) = = = (3, 6).
t3 − t2 4−3
then
(t2 − 2)P01 (2) + (2 − t0 )P12 (2) (3 − 2)P01 (2) + (2 − 0)P12 (2) 14
P012 (2) = = = ( , 4)
t2 − t0 3−0 3
(t3 − 2)P12 (2) + (2 − t1 )P23 (2) (4 − 2)P12 (2) + (2 − 1)P23 (2) 11
P123 (2) = = = ( , 4)
t3 − t1 4−1 3
and finally
(t3 − 2)P012 (2) + (2 − t0 )P123 (2) (4 − 2)P012 (2) + (2 − 0)P123 (2) 25
P0123 (2) = = = ( , 4)
t3 − t0 4−0 6

10.5 Comparison
We have outlined four different methods for finding a polynomial of degree n that interpolates n + 1
points. The method of undetermined coefficients requires the solution of n + 1 equations in n + 1
unknowns. Lagrange interpolation allows you to write down the equation of the polynomial, but
each evaluation requires O(n2 ) operations. Newton polynomials evaluation can be performed in
O(n) but there is some preprocessing involved in the divided difference table. Evaluation using
Neville’s scheme is O(n2 ). Thus, if you need to evaluate a lot of points, Newton polynomials are
the preferred method. They are also numerically stable, assuming the points you are evaluating are
within the min and max t values of the sample points.

10.6 Error Bounds


We can use degree n Lagrange polynomials to approximate any function by interpolating n+1 points
f (x0 ), f (x1 ), . . . f (xn ) on the function. In the following equation, f (x) is the function we wish to
approximate and p(x) is the Lagrange approximation.

f (n+1) (ξ)
f (x) − p(x) = (x − x0 )(x − x1 ) · · · (x − xn ) (10.1)
(n + 1)!

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
112 Error Bounds

The value f (n+1) (ξ) is the (n+1)th derivative of f (x) evaluated at some value ξ where min(x, x0 , . . . , xn ) ≤
ξ ≤ max(x, x0 , . . . , xn ). If we can determine a bound on this derivative, then equation 10.1 can be
used to provide an error bound on our approximation.

f(x0) f(x)

P1(x) f(x1)

x
x0 x1

Figure 10.3: Error Bounds

A particularly useful case for equation 10.1 is n = 1, or linear approximation. In this case, we
can compute the maximum distance that a polynomial deviates from a straight line. If the straight
line is
f (x0 )(x1 − x) + f (x1 )(x − x0 )
p1 (x) =
x1 − x0
then
max(min(x,x0 ,x1 )≤x≤max(x,x0 ,x1 )) (f 00 (x))
|f (x) − p1 (x)| ≤ (x − x0 )(x − x1 ).
2
Let δ = x1 −x0 and L = max(min(x,x0 ,x1 )≤x≤max(x,x0 ,x1 ) (f 00 (x)). Since the expression (x−x0 )(x−x1 )
(x1 −x0 )2 δ2
has a maximum value at x = x0 +x1
2 of 4 = 4 ,

δ2
|f (x) − p1 (x)| ≤ L .
8
We can assure that the approximation error will be less than a specified tolerance  by using m line
segments whose endpoints are evenly spaced in x, where
r
L
m≥ (x1 − x0 ).
8
A useful application of this idea is to determine how many line segments are needed for plotting
a Bézier curve so that the maximum distance between the curve and the set of line segments is less
than . Figure 10.4 shows a cubic Bézier curve approximated with various numbers of line segments.
In this case, we simply get a bound on the error in x coordinates and y coordinates independently,
and apply the Pythagorean theorem. Bounds (Lx , Ly ) on the second derivatives of Bézier curves are
easily obtained by computing the second hodograph:
Lx = n(n − 1) max |xi+2 − 2xi+1 + xi | (10.2)
0≤i≤n−2

and
Ly = n(n − 1) max |yi+2 − 2yi+1 + yi |, (10.3)
0≤i≤n−2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Error Bounds 113

5 segments 10 segments 15 segments

20 segments 25 segments 30 segments

Figure 10.4: Piecewise linear approximation of a Bézier curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
114 Interpolating Points and Normals

Now, if we use m line segments for approximating the curve where


vq
u
u L2 + L2
t x y
m≥ ,
8
the maximum error will be less than .
We can likewise determine how many times r a Bézier curve must be recursively bisected until
each curve segment is assured to deviate from a straight line segment by no more than  [GZ84]:
vq
u
u L2 + L2
x y
r = log2 (10.4)
t
8
This form of the approximation error equation is useful for applications such as computing the
intersection between two curves.

10.6.1 Chebyshev Polynomials


If we wish to use a Lagrange polynomial of degree greater than one to perform approximation, we see
from equation 10.1 that a wise choice of the interpolation points xi can improve the approximation
error. From equation 10.1,

f (n+1) (x)
|f (x) − p(x)| ≤ max max |(x − x0 )(x − x1 ) · · · (x − xn )| (10.5)
a≤x≤b (n + 1)! a≤x≤b

where x, x0 , . . . , xn ∈ [a, b]. If we want to decrease the approximation error, we have no con-
(n+1)
trol over maxa≤x≤b f (n+1)! (x)
. However, there is an optimal choice for the xi which will minimize
maxa≤x≤b |(x − x0 )(x − x1 ) · · · (x − xn )|.
One might make an initial guess that the best choice for the xi to minimize maxa≤x≤b |(x −
x0 )(x − x1 ) · · · (x − xn )| would be simply to space them evenly between x0 and xn . This actually
gives pretty good results. For the interval [a, b] with xi = a + (b − ai )/n, it is observed that at least
n
for 4 ≤ n ≤ 20, maxa≤x≤b |(x − x0 )(x − x1 ) · · · (x − xn )| ≈ b−a
3 .
The best choice for the xi is the Chebyshev points:
a+b b−a 2i + 1
xi = + cos π, i = 0, . . . , n − 1. (10.6)
2 2 2n + 2
n
In this case, maxa≤x≤b |(x − x0 )(x − x1 ) · · · (x − xn )| ≡ 2 b−a
4 .
Figure 10.5 shows the Chebyshev and uniform spacing for degree nine polynomials.

10.7 Interpolating Points and Normals


It is possible to use the method of undetermined coefficients to specify tangent vectors as well as
interpolating points. For example, consider the cubic parametric curve

P(t) = a0 + a1 t + a2 t2 + a3 t3 .

The derivative of the curve is


P0 (t) = a1 + 2a2 t + 3a3 t2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Interpolating Points and Normals 115

.0000367
0.00000763

Degree 9, evenly spaced xi Degree 9, Chebyshev spacing

Figure 10.5: Two cases of (x − x0 )(x − x1 ) · · · (x − x9 ) for 0 ≤ x ≤ 1.

It should be obvious that we can now specify, for example, P(t1 ), P(t2 ), P0 (t3 ) and P0 (t4 ). Alter-
nately, we can specify three interpolating points and one slope, or three slopes and one interpolating
point, etc.
An important case of specifying points and tangent vectors is the Hermite blending functions.
In this case, the curve is determined by specifying P(0), P(1), P0 (0), and P0 (1) - that is, the two
end points and the two end tangent vectors. Solving this case using the method of undetermined
coefficients, we obtain the cubic Hermite curve:

P(t) = P(0)(2t3 − 3t2 + 1) + P(1)(−2t3 + 3t2 ) +

P0 (0)(t3 − 2t2 + t) + P0 (1)(t3 − t2 )

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
116 Interpolating Points and Normals

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 11

Approximation

Xin Li, from the University of Science and Technology of China, contributed significantly to this
chapter.

11.1 Introduction
Approximation theory plays an important role in computer aided geometry design and computer
graphics. A common general problem in approximation theory can be stated as follows. Let G
denote a set of given data. Let A denote a set (usually infinite) of candidate mathematical objects
(such as functions, parametric surfaces, T-Splines, etc.) with which to approximate G. Let e(Ai , G)
be an error measure that indicates how well Ai ∈ A approximates G. We wish to find a “best”
approximation Ai ∈ A for which e(Ai , G) ≤ e(Aj , G)∀Aj ∈ A. Since finding a best approximation
can involve expensive optimization algorithms, we might be content to find any approximation for
which e(Ai , G) is less than a threshold error. A few simple examples will illustrate.
Example 1. Let G = {2, 3, 3, 5, 7} and let A be the set of all real numbers. If we choose the
error measure to be X
e(Ai , G) = ((Ai − G)2
G∈G

the best approximation is Ai = 4 for which e(4, G) = 16. This error measure is referred to as the
L2 error measure, and the best approximation is the mean of the values in G.
Example 2. Again, let G = {2, 3, 3, 5, 7} and let A be the set of all real numbers. Let the error
measure be
e(Ai , G) = max |Ai − G|.
G∈G

The best approximation is now Ai = 4.5, for which e(4, G) = 2.5. This error measure is referred
to as the L∞ error measure, and the best approximation is the average of the largest and smallest
values in G. Thus, different error functions can produce different best approximations.
Example 3. Let G be a Bézier curve of degree n (call it P(t)) and let A be the set of all Bézier
curves of degree n − 1, and A(t) a Bézier curve in A. Let the error measure be

max ||P(t) − A(t)||, t ∈ [0, 1].

This is the “degree reduction” problem.

117
118 L2 Error

Example 4. Let G be a B-Spline curve (call it P(t)) of degree n, knot vector k, and domain
t ∈ [t0 , t1 ]. Let A be the set of all B-Spline curves of degree n and with a knot vector k̃ which is
obtained by removing one or more knots from k. Let A(t) be a curve in A. Let the error measure
be
max ||P(t) − A(t)||, t ∈ [0, 1].
This is the “knot removal” problem.
Example 5. G is a large set of data points, measured on the surface of a physical object. A is
a set of NURBS, T-Splines, or Subdivision Surfaces. This is the “reverse engineering,” for which it
is customary to use the L2 error measure.
Example 6. In drawing a curve or surface, it is customary to approximate the curve with a
polygon, or the surface with a polyhedron. These are examples of approximating a continuous object
with a simpler continuous object. The question of how many line segment or triangles are needed
to make the curve or surface appear smooth belongs to approximation theory.

11.2 L2 Error
The L2 error measure is widely used in approximation problems because in many cases it is partic-
ularly easy to identify Ai that minimizes the L2 error measure. Approximation using the L2 error
measure is also called “least squares” approximation. In the case where G is a set of real numbers,
the best L2 approximation is simply the mean of those numbers. Specifically, let
n
X
f (x) = (x − xi )2 .
i=1

Then we have the following lemma.


Pn
xi
Lemma 11.2.1 Suppose x̂ = i=1
n , then
f (x) ≥ f (x̂).
Proof 1
n
X
f (x) − f (x̂) = [(x − xi )2 − (x̂ − xi )2 ]
i=1
n
X
= [(x − x̂)(x + x̂ − 2xi )]
i=1
n
X
= (x − x̂)(nx − xi )
i=1
= n(x − x̂)2 ≥ 0
So the lemma holds.

11.3 Approximating a Set of Discrete Points with a B-Spline


Curve
Let G be a set of data points Pi = (xi , yi , zi ), i = 1, . . . , M , with associated parameter values, ti .
Let A be the set of all B-Spline curves with a given knot vector and degree. We seek Ai ∈ A that

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Approximating a Set of Discrete Points with a B-Spline Curve 119

Pn
minimizes the discrete L2 error where Ai ∈ A is given by B(t) = j=1 Tj Bj (t). This amounts to
identifying the B-Spline control points T1 , T2 , . . . , Tn that minimize the function
M
X n
X
Lsq(T1 , T2 , . . . , Tn ) = (Pi − Tj Bj (ti ))2 . (11.1)
i=1 j=1

This problem reduces to the solution of the following linear functions:

∂Lsq(T1 , T2 , . . . , Tn )
= 0. (11.2)
∂Tj

We can solve for the control points Ti from the linear equation

Mf it ∗ T = B (11.3)
PM
where Mf it is a n × n matrix with element aij = k=1 Bi (sk )Bj (sk ). T = [Ti ] is the vector of
PM
control points for which we are solving and B is a vector whose elements are bi = k=1 Pk Bi (tk ).

Algorithm 1 Setting Up the fitting matrix Mf it


Require: sample points Pi , associated parameter values (ti ), knot vector and degree for the B-Spline
curve.
Ensure: Mf it = [aij ]
for i = 1 to N do
for j = i to N do
aij ⇐ aji ⇐ 0
Ωij = Support(Bi ) ∩ Support(Bj )
if Ωij 6= ∅ then
for k = 1 to M do
if (sk ) ∈ Ωij then
d ⇐ Bi (sk ) ∗ Bj (sk )
aij + = d
aji + = d
end if
end for
end if
end for
end for

The prudent choice of si for each sample point Pi , which determines the parametrization of the
curve, is crucial in obtaining a good fit. The choice of knot vector or knot intervals can also impact
the quality of the fit. The next two subsections elaborate on these topics.

11.3.1 Parametrization
The simplest parametrization assigns evenly spaced parameter values to the data points:

j−1
tj = . (11.4)
M −1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
120 Approximating a Set of Discrete Points with a B-Spline Curve

Figure 11.1: Uniform vs. bad parametrization.

This uniform parametrization works well if the data points are evenly spaced, as illustrated in
Figurefig:1.
The second is arc length parametrization, which is defined as

Pj
kPi − Pi−1 k
sj = Pi=2
M
. (11.5)
i=2 kPi − Pi−1 k

Figure 11.2: Arc length vs. bad parametrization.

The uniform parametrization only suits for regular sample points. The arc length parametrization
is much more popular. Here we will give some examples to show the result of least square fitting with
different parametrization. In the following examples, the red line is the control polygon and the blue
points are the sample points. Figure 11.2,11.1 are two examples of using different parametrization.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Fairing 121

11.3.2 Knot vector


Knot vectors are also very important for the curve or surface fitting. As we known, the degree three
B-spline function which associated with knot vector s = [s0 , s1 , s2 , s3 , s4 ] is zero out of the interval
[s0 , s4 ], which is called the support of the basis function. The knots and the parameters are the keys
for the structure of the matrix Mf it . So if the knots around some parameter are very sparse but
very dense around some others, then the curve won’t be very good, to see 11.3 as an example. The
second picture is fitting with a very bas knots which are very dense among the first six knots.
In general, the knots are selected as the subset of the parametrization. Given a integer m, then
then knots are sj∗m respectively. Bad knots also will lead to very bad spline curve. Figure 11.3 gives
some examples. The first picture is fitting with uniform knots.

11.4 Fairing
In order to get smooth curve or surface to fit the given samples
R points very well, we often add some
energy to the equation 11.3. For curve, the item often used is fss2
. So the problem is changed to
M
X n
X Z X n
min (Pi − Tj Bj (si ))2 + c ( Tj Bj (s))2 ) (11.6)
i=1 j=1 j=1

Here the constant c is defined by user. But this constant is very important for the result curve and
it is very difficult to choose the constant. Similarly, the problem also equates the solution of the
following linear functions:
(Mf it + cMf air ) ∗ T = B; (11.7)
Here the algorithm for computing the fairing matrix is listed as follows:

Algorithm 2 Compute the fairing matrix Mf air


Require: all the blending functions Bi
Ensure: Mf air = [bij ]
for i = 1 to N do
for j = i toN do
aij ⇐ aji ⇐ d ⇐ 0
Ωij = Support(Biss ) ∩ Support(Bjss ) = [a, b]
if Ωij 6= ∅ then
k ⇐ 10, l ⇐ 10
for i1 = 1 to 2k − 1, i1+ = 2 do
d+ = Biss (a + i1(b−a)
2k )Bjss (a + i1(b−a)
2k )
end for
end if
d× = (b − a)/(k)
aij + = d
aji + = d
end for
end for

Figure 11.4 illustrated two pictures which are least square fitting and after fairing. We can see
that after fairing, the curve becomes much better.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
122 Fairing

But as we just said, it is very difficult to choose the constant. A larger constant will leads the
curve to be shrank, to see Figure 11.5 as an examples.
We must mention here that it is very difficult to smooth a curve with bad parameters. Figure
11.6 gives the example. With a bigger constant, the curve will be shrank as the picture in Figure
11.5.

11.4.1 Interpolation
The interpolation means that we specify some points that the result curve must pass through. Sup-
pose the interpolation points are Qi , i = 1, . . . , I, and the associated parameter are ui respectively.
Then the problem turns to
M
X n
X Z X n
min (Pi − Tj Bj (si ))2 + c ( Tj Bj (s))2 )
i=1 j=1 j=1

n
X
subject to: Tj Bj (ui ) = Qi , i = 1, . . . , I.
j=1

Using Lagrange Multiplier method, we also can change the problem to


M
X n
X Z Xn I
X n
X
min (Pi − Tj Bj (si ))2 + c ( Tj Bj (s))2 ) + λk ( Tj Bj (uk ) − Qk )
i=1 j=1 j=1 k=1 j=1

The derivations of the function for all the Tj and λk are all zero. all the linear functions can be
written as a matrix form:

Mf it + cMf air
 
| A
 − − − − − − − + −−  [T1 , . . . , Tn , λ1 , . . . , λI ]T = [B|C]T
AT | 0

Here A is a matrix with n rows and I columns which element of i − th rows and j − th columns
is
aij = Bi (uj ), 1 ≤ i ≤ n, 1 ≤ j ≤ I.
And the element of C is
Rj = Qj , 0 < i ≤ I.
Solve the linear functions, we can compute all the control points for the curve. But the result
curve is also associated with the constant. The curve is much less sensitive than that of without
interpolation. Figure 11.7 shows an example of interpolation with different constants. In the next
section, we will give the method for eliminating the constant.

11.4.2 Constrained fairing


In this section, we will discuss a new idea for constructing a fairing curve or surface.
Denote
Xn
Lε = {f |f =
2
Ti Bi (s), Lsq(T1 , T2 , . . . , Tn ) < ε}. (11.8)
i=1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Fairing 123

If ε is less than the least square error, then the set is null. The idea for fairing is that select the
fairest curve from L2ε according to a given error ε. The problem is a convex problem. But it is very
difficult to solve. So we want to reduce the condition to turn the problem to a linear condition.
Define a bound box BXi for each sample point Pi , and we restrict real point belongs to the
bound box. That is to say, we want to find the fairest curve from the space:
n
X
L = {f |f (s) = Ti Bi (s), f (ui ∈ BXi )}. (11.9)
i=1

Here we will define two kinds of bounding box, the first is very popular, which parallel to the
coordinates.
BXi = {(x, y)|sxi ≤ x ≤ lxi , syi ≤ y ≤ lyi } (11.10)
Then the problem can be divided into two or three independent problems such like that:
min X T HX
subject to: AX ≤ B (11.11)
Here
X = [x1 , x2 , . . . , xM ];
Z
H = [hij ]n×n , hij = Bi (s)Bj (s);

A = [aij ]2M ×n , aij = a(i+M )j = Bj (ui );


B = [bi ]2M , bi = lxi , bi+M = −sxi .
Here X is a vector of all the control points. H is called the Hessian matrix for the object function
and A is the constrain matrix.
The results are listed in Figure 11.8. All the parameters are same as those of in Figure 11.7. If
we set very big bound boxes, then we compute a line.
The second boxes are associated with the neighbors of the sample points. We estimate a tangent
vector ti and a normal vector ni for each point, and the bound box for the point is
BXi = {Pi + s ∗ ti + t ∗ ni | − 0.5 ≤ s ≤ 0.5, −0.5 ≤ t ≤ 0.5, } (11.12)
Then the problem become to a similar problem as 11.11.
X = [x1 , x2 , . . . , xM , y1 , y2 , . . . , yM ];
Z
H = [hij ]2n×2n , hij = h(i+n)(j+n) Bi (s)Bj (s);

A = [aij ]4M ×2n , (aij , ai(j+n) ) = −(a(i+M )j , a(i+M )(j+n) ) = Bj (ui )ti ,
(a(i+2M )j , a(i+2M )(j+n) ) = −(a(i+3M )j , a(i+3M )(j+n) ) = Bj (ui )ni ;
B = [bi ]4M , bi = Pi · ti + 0.5ti · ti , bi+M = −Pi · ti + 0.5ti · ti ,
bi+2M = Pi · ni + 0.5ni · ni , bi+3M = −Pi · ni + 0.5ni · ni ,
Solve the quadratic problem, we can get the solution. We can see that it is much better than both
least square and fairing.
Here the tangent ti and normal ni for each point Pi are estimated with a very simple method.
Let P0 = P1 and PM +1 = PM , then the direction of ti is the same as Pi+1 − Pi−1 . ni is the
perpendicularity direction of ti .

11.4.3 Images

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
124 Fairing

Figure 11.3: Uniform vs. bad knots.

Figure 11.4: The fairing effect.

Figure 11.5: The shrank curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Fairing 125

Figure 11.6: The fairing effect of bad parameter.

Figure 11.7: Fairing and interpolation with different constant.

3
5

2.5
4

2 3

1.5 2

1 1

0.5 0

0 −1

−0.5 −2
−5 −4 −3 −2 −1 0 1 2 3 4 5 −6 −4 −2 0 2 4 6

Figure 11.8: Constrained fairing.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
126 Fairing

3 3

2.5 2.5

2 2

1.5 1.5

1 1

0.5 0.5

0 0
−5 −4 −3 −2 −1 0 1 2 3 4 5 −5 −4 −3 −2 −1 0 1 2 3 4

Figure 11.9: Constrained fairing.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 12

Interval Bézier Curves

In recent years there has been considerable interest in approximating the curves and surfaces that
arise in computer–aided design applications by other curves and surfaces that are of lower degree, of
simpler functional form, or require less data for their specification (see, for example, [Hos87], [Hos88],
[Lac88], [LM87], [Pat89], [SK91], [SWZ89], [WW88]). The motivation for this activity arises from
the practical need to communicate product data between diverse CAD/CAM systems that impose
fundamentally incompatible constraints on their canonical representation schemes, e.g., restricting
themselves to polynomial (rather than rational) forms, or limiting the polynomial degrees that they
accommodate.
While most of the approximation schemes in the references cited above attempt at minimum to
guarantee that an approximation will satisfy a prescribed tolerance, once this has been achieved none
of them proposes to carry detailed information on the approximation error forward to subsequent
applications in other systems. Such information can be of crucial importance, for example, in
tolerance analyses of the components of a mechanism. This chapter describes a form — the interval
Bézier curve — that is capable of carrying such information, and we show how a complete description
of approximation errors may be readily embodied in such forms in a straightforward and natural
manner.

12.1 Interval arithmetic and interval polynomials


By a scalar interval [ a, b ] we mean a closed set of real values of the form
[ a, b ] = { t | a ≤ t ≤ b } . (12.1)
Given two such intervals [ a, b ] and [ c, d ], the result of a binary arithmetic operation ? ∈ { + , − , · , / }
on them is defined to be the set of all values obtained by applying ? to operands drawn from each
interval:
[ a, b ] ? [ c, d ] = { x ? y | x ∈ [ a, b ] and y ∈ [ c, d ] } . (12.2)
Specifically, it is not difficult to verify that
[ a, b ] + [ c, d ] = [ a + c, b + d ] ,
[ a, b ] − [ c, d ] = [ a − d, b − c ] ,
[ a, b ] · [ c, d ] = [ min(ac, ad, bc, bd), max(ac, ad, bc, bd) ] ,
[ a, b ] / [ c, d ] = [ a, b ] · [ 1/d, 1/c ] , (12.3)

127
128 Interval arithmetic and interval polynomials

where division is usually defined only for denominator intervals that do not contain 0. Occasionally,
we shall wish to treat a single real value as a degenerate interval,

a = [ a, a ] (12.4)

so that we can apply the rules (12.3) to mixed operands (e.g., a + [ b, c ] = [ a + b, a + c ]). We shall
also make use of a convenient short–hand notation for intervals, denoting them by a single symbol
enclosed in square parentheses, e.g., [ u ] = [ a, b ] and [ v ] = [ c, d ]. (However, the reader is warned
against allowing this notation to impart an undue sense of familiarity — note, for example, that
[ u ] − [ u ] 6= 0 in general!)
It can be verified from (12.3) that interval addition and multiplication are commutative and as-
sociative, but that multiplication does not, in general, distribute over addition. A notable exception
is the multiplication of a sum of intervals by a scalar value, for which

α ([ u ] + [ v ]) = α[ u ] + α[ v ] (12.5)

holds for arbitrary real values α and intervals [ u ], [ v ]. An example of the converse case — the sum
of scalar multiples of a given interval — is given in equation (12.24) below. For a more rigorous and
detailed discussion of these matters, see [Moo66], [Moo79].
Interval arithmetic offers an essentially infallible (although often pessimistic) means of monitoring
error propagation in numerical algorithms that employ floating point arithmetic. Many familiar
algorithms can be re–formulated to accept interval operands (e.g., [Han78b], [Han78a]). The use of
interval techniques in the context of geometric modeling calculations has been discussed in [MK84].
An interval polynomial is a polynomial whose coefficients are intervals. We shall denote such
polynomials in the form [ p ](t) to distinguish them from ordinary (single–valued) polynomials. In
general we express an interval polynomial of degree n in the form
n
X
[ p ](t) = [ ak , bk ] Bkn (t) , (12.6)
k=0

in terms of the Bernstein polynomial basis


 
n
Bkn (t) = (1 − t)n−k tk for k = 0, . . . , n (12.7)
k

on [ 0, 1 ]. Using (12.3), the usual rules of polynomial arithmetic can be carried over with minor
modifications to the case of interval polynomials (see [Rok75]; polynomial arithmetic in the Bernstein
basis is described in [FR88]). Since the basis functions (12.7) are evidently all non–negative for
t ∈ [ 0, 1 ], we can also express (12.6) in the form

[ p ](t) = [ pmin (t), pmax (t) ] for all t ∈ [ 0, 1 ] , (12.8)

where
n
X n
X
pmin (t) = ak Bkn (t) and pmax (t) = bk Bkn (t) . (12.9)
k=0 k=0

A useful concept in dealing with interval polynomials defined over a finite domain as approxima-

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Interval Bézier curves 129

tion tools is the width of such a polynomial,


Z 1
width( [ p ](t) ) = pmax (t) − pmin (t) dt
0
n
X Z 1
= (bk − ak ) Bkn (t) dt
k=0 0
n
1 X
= bk − ak . (12.10)
n+1
k=0

The last step follows from the fact that the definite integral of each of the basis functions (12.7) over
[ 0, 1 ] is just 1/(n + 1) [FR88].
The width (12.10) measures the total area enclosed between the two polynomials (12.9) that
define the upper and lower bounds on [ p ](t) over t ∈ [ 0, 1 ]. The Bernstein–Bézier formulation
(12.6) has the convenient feature that the width of an interval polynomial [ p ](t) is simply the
average of the widths bk − ak of its coefficients.
A desirable characteristic of any scheme that calls for approximation by interval polynomials is
to provide a means whereby successive approximations of uniformly decreasing width are generated.
The approximated function can thus be confined within as small an area as desired.

12.2 Interval Bézier curves


We will define a vector–valued interval [ p ] in the most general terms as any compact set of points
(x, y) in two dimensions. The addition of such sets is given by the Minkowski sum,

[ p1 ] + [ p2 ] = { (x1 + x2 , y1 + y2 ) | (x1 , y1 ) ∈ [ p1 ] and (x2 , y2 ) ∈ [ p2 ] } . (12.11)

Such point–set operations arise, for example, in image analysis [Ser82]. However, since they are
in general quite difficult to perform algorithmically (even when [ p1 ] and [ p2 ] are restricted to
polygonal boundaries), it will be prudent for the present to restrict our attention to vector–valued
intervals that are just the tensor products of scalar intervals,

[ p ] = [ a, b ] × [ c, d ] = { (x, y) | x ∈ [ a, b ] and y ∈ [ c, d ] } . (12.12)

We occasionally use the notation ([ a, b ], [ c, d ]) instead of [ a, b ] × [ c, d ] for [ p ]. Such vector–valued


intervals are clearly just rectangular regions in the plane, and their addition is a trivial matter:

[ p1 ] + [ p2 ] = [ a1 + a2 , b1 + b2 ] × [ c1 + c2 , d1 + d2 ] , (12.13)

where [ p1 ] = [ a1 , b1 ] × [ c1 , d1 ] and [ p2 ] = [ a2 , b2 ] × [ c2 , d2 ]. The extension of these ideas to


vector–valued intervals in spaces of higher dimension is straightforward.
We note that there are other potentially useful shapes for interval control points (e.g., circular
disks); the discussion that follows adapts readily to interval control points of more general shape,
although specific algorithms may be more difficult to implement than in the tensor–product case.
Let us recall now that a Bézier curve on the parameter interval [ 0, 1 ] is defined by
n
X
P(t) = Pk Bkn (t) , (12.14)
k=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
130 Interval Bézier curves

where the Bernstein basis function Bkn (t) are as defined above in (12.7). The vector coefficients
Pk = (xk , yk ) in (12.14) are called the control points of the curve.
An interval Bézier curve (i.e., a Bézier curve with vector–interval control points) is written in
the form
n
X
[ P ](t) = [ Pk ] Bkn (t) , (12.15)
k=0

where we assume that the [ Pk ] are rectangular (possibly degenerate) intervals of the form (12.12).
Figure 12.1 illustrates a sample cubic interval Bézier curve.

[P2]
[P1]

[P0]

[P3]

Figure 12.1: A cubic interval Bézier curve.

For each t ∈ [ 0, 1 ], the value [ P ](t) of the interval Bézier curve (12.15) is a vector interval that
has the following significance: For any Bézier curve P(t) whose control points satisfy Pk ∈ [ Pk ]
for k = 0, . . . , n, we have P(t) ∈ [ P ](t). Likewise, the entire interval Bézier curve (12.15) defines
a region in the plane that contains all Bézier curves whose control points satisfy Pk ∈ [ Pk ] for
k = 0, . . . , n.
We shall not concern ourselves here with defining curves of the form (12.15) ab initio, but rather
with the use of that form in approximating more complicated curves and surfaces by polynomial
interpolation in such a manner that the interval control points [ Pk ] reflect the approximation error.
Thus, the plane region defined by an interval approximant [ P ](t) to some other curve r(t) will be
guaranteed to contain the latter.
While an initial approximant of this form may be unacceptably crude — defining an area that
is too large for practical purposes — a process of refinement by subdivision will usually remedy
this problem. A precise representation of the error incurred by approximations can be crucial in
applications such as tolerance analysis, where a nominal approximant is of little value without
information on its deviation from the exact form. The Bernstein–Bézier form offers an intuitive
framework for expressing approximants, along with their error terms, as interval–valued polynomials.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Interval Bézier curves 131

12.2.1 Affine maps


A key operation in the de Casteljau subdivision and degree elevation algorithms for Bézier curves
(see [Far90]) is computing the affine map

M(p0 , p1 , t) = (1 − t) p0 + t p1 (12.16)

of two points p0 and p1 (we consider for now the case where p0 and p1 are simply scalar values).
This map can be visualized as shown in Figure 12.2, where the values of p0 and p1 are taken as the
vertical coordinates, and the values of t as horizontal coordinates. At t = 0, y = p0 while at t = 1,
y = p1 . The affine map is then represented graphically by drawing a straight line through p0 and
p1 . This line can be regarded as the affine map function for the two points: at any value of t, the
affine map is simply the vertical coordinate of the line.

p1

(1-t) p0 + t p1
p0

0 t 1

Figure 12.2: The affine map of two scalar points.

Consider next the affine map of two scalar intervals:

[ M ]( [ a, b ], [ c, d ], t ) = (1 − t) [ a, b ] + t [ c, d ]
= { (1 − t) u + t v | u ∈ [ a, b ] and v ∈ [ c, d ] } . (12.17)

The affine map (12.17) can be visualized as shown in Figure 12.3 — for a given value of t,

+td
(1-t)a
d
d
(1-t)b + t
(1-t)b + t c b c (1-t)b + t c
tc
(1-t)a +
a
+td
(1-t)a 0 t 1

Figure 12.3: The affine map of two scalar intervals.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
132 Interval Bézier curves

[ M ]( [ a, b ], [ c, d ], t ) is generated by drawing a vertical line at that t value and identifying all points
on that line which are collinear with any point in [ a, b ] at t = 0 and any point in [ c, d ] at t = 1.
Qualitatively, we see that the width of the affine map (12.17) lies between the widths of [ a, b ] and
[ c, d ] when t ∈ [ 0, 1 ], whereas the width of the affine map grows linearly — without bound — for t
outside the unit interval.
The affine map of two vector-valued intervals [P0 ] and [P1 ] as defined in equation 12.12 is simply

[ M ]( [P0 ], [P1 ], t ) = { (1 − t) u + t v | u ∈ [P0 ] and v ∈ [P1 ] } (12.18)

as shown in figure 12.4. Observe that the midpoint, width, and height of the affine map rectangle

[P1]

(1-t)[P0 ]+t[P1 ]

[P0 ]

Figure 12.4: The affine map of two vector intervals.

are simply affine maps of the midpoints, widths, and heights of [P0 ] and [P1 ].
For a Bézier curve of the form (12.14), we may regard the de Casteljau algorithm as a repeated
(0)
application of (12.16) to the control points {Pk }. With Pk = Pk for k = 0, . . . , n, we set

(r+1) (r) (r)


Pk = M ( Pk−1 , Pk , t ) for k = r + 1, . . . , n (12.19)

(r)
and r = 0, . . . , n − 1. This generates a triangular array of the quantities {Pk } — the final entry
(n)
Pn in this array corresponds to the point P(t) on the curve (12.14), while the entries

(0) (1)
P0 , P1 , . . . , P(n)
n and Pn(n) , P(n−1)
n , . . . , P(0)
n (12.20)

on the left– and right–hand sides of the array are the control points for the subsegments of P(t) over
the parameter intervals [ 0, t ] and [ t, 1 ], respectively. To apply (12.19) to interval Bézier curves, we
(r)
simply replace the quantities Pk by their interval counterparts, and invoke the appropriate rules
of interval arithmetic, as illustrated in Figure 12.5. We discuss the de Casteljau algorithm further
in the next section.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Interval Bézier curves 133

[P1] [P2]

[P0]
[P3]

Figure 12.5: Interval de Casteljau algorithm.

12.2.2 Centered form


All the familiar algorithms and characteristics that we associate with Bézier curves — the subdivision
and degree elevation algorithms, the variation–diminishing property and convex-hull confinement
(see [Far90] for a review) — carry over to Bézier curves with interval coefficients under relatively
minor modifications or re–interpretations.
For the case of tensor–product interval control points of the form (12.12), these operations can
be more conveniently formulated if the control points are expressed in centered form. We re–write
each control point [ Pk ] in the following manner:

[ Pk ] = ([ ak , bk ], [ ck , dk ])
1 1
= (ak + bk , ck + dk ) + (bk − ak , dk − ck ) [ −1, +1 ]
2 2
= [ Pk ] + ek [ i ] (12.21)

where [ i ] denotes the interval [ −1, +1 ]. In (12.21), the point [ Pk ] is the center of the vector
interval [ Pk ], while the vector ek is the error of [ Pk ]. Note that the x and y components of ek are
necessarily non–negative.
Using centered form, the affine map of two interval points may be written as

(1 − t) [ P0 ] + t [ P1 ] = (1 − t) {[ P0 ] + e0 [ i ]} + t {[ P1 ] + e1 [ i ]}
= {(1 − t) [ P0 ] + t [ P1 ]} + {(1 − t) e0 + t e1 }[ i ] , (12.22)

where we assume that 0 ≤ t ≤ 1. Thus, the affine map of two interval points can be computed by
independently taking the affine maps of their centers and their errors.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
134 Interval Bézier curves

For 0 ≤ t ≤ 1, an interval Bézier curve may be expressed in centered form as follows:


n
X
[ P ](t) = [ Pk ] Bkn (t)
k=0
Xn
= {[ Pk ] + ek [ i ]} Bkn (t)
k=0
Xn n
X
= [ Pk ] Bkn (t) + [ i ] ek Bkn (t)
k=0 k=0

= [ P ](t) + [ i ] e(t) (12.23)

In bringing the interval [ i ] outside the summation sign above we rely on the fact that, for each
k = 0, . . . , n, the x and y components of ek are non–negative and Bkn (t) ≥ 0 for t ∈ [ 0, 1 ].
Thus, the interval Bézier curve [ P ](t) over 0 ≤ t ≤ 1 can be split into two independent “com-
ponents” — a center curve [ P ](t), and an error curve e(t). Note that the control points ek of e(t)
all lie within the first quadrant, and consequently the error curve is itself contained within that
quadrant for t ∈ [ 0, 1 ].
Equation (12.22) suggests that for t outside the unit interval, the error curve should grow mono-
tonically. Writing equation (12.17) in centered form with [ a, b ] = p0 + e0 [ i ] and [ c, d ] = p1 + e1 [ i ],
and noting that
α[ i ] + β[ i ] = (|α| + |β|) [ i ] (12.24)
for arbitrary real numbers α and β, we see that the expressions

[ M ](p0 + e0 [ i ], p1 + e1 [ i ], t)

 p0 (1 − t) + p1 t + {e0 (1 − t) − e1 t} [ i ] for t < 0 ,


= p0 (1 − t) + p1 t + {e0 (1 − t) + e1 t} [ i ] for 0 ≤ t ≤ 1 , (12.25)


p0 (1 − t) + p1 t + {e0 (t − 1) + e1 t} [ i ] for t > 1 ,

= p0 (1 − t) + p1 t + {e0 |1 − t| + e1 |t|}[i] (12.26)

describe the behavior of the affine map of two scalar intervals for all real t (see Figure 12.4).
The de Casteljau algorithm (12.19) is essentially a repeated application of the affine map (12.25).
Figure 12.5 illustrates for the case t = 21 . By studying the behavior of the de Casteljau algorithm
applied to an interval Bézier curves outside the unit interval, equation (12.25) leads to the following
expressions:  n
X
[ Pk ] Bkn (t) + e(t)[ i ] for 0 ≤ t ≤ 1 ,





[ P ](t) = k=0
Xn (12.27)
[ P ] n
(t) + ẽ(t)[ ] for 0 or 1




 k B k i t < t > ,
k=0

where e(t) is the error curve for t ∈ [ 0, 1 ] defined in (12.23), and


n
X
ẽ(t) = (−1)k ek Bkn (t) . (12.28)
k=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Interval Bézier curves 135

defines an error curve that is appropriate to the domains t < 0 and t > 1. (Alternately, we may
substitute |Bkn (t)| = (−1)k Bkn (t) when t < 0, and |Bkn (t)| = (−1)n+k Bkn (t) when t > 1, into
n
X
[ P ](t) = {[ Pk ] + ek [ i ]} Bkn (t) (12.29)
k=0

n
X n
X
= [ Pk ] Bkn (t) + [ i ] ek |Bkn (t)| ,
k=0 k=0

and set (−1)n [ i ] = [ i ] in the case t > 1, in order to obtain (12.27)).

12.2.3 Error monotonicity


Both the x and y components of the error curve ẽ(t) grow monotonically as t departs from the unit
interval [ 0, 1 ]. To appreciate this, we note that the r–th derivative of the Bézier curve (12.14) can
be written as a Bézier curve of degree n − r,

n−r
n! X
P(r) (t) = ∆r Pk Bkn−r (t) , (12.30)
(n − r)!
k=0

where the quantities {∆r Pk } are the r–th forward differences of the control points, given by
r  
X r
∆ r Pk = (−1)j Pk+r−j for k = 0, . . . , n − r . (12.31)
j=0
j

The forward differences can be generated by the recursion

∆r+1 Pk = ∆r Pk+1 − ∆r Pk (12.32)

which commences by setting ∆Pk (= ∆1 Pk ) = Pk+1 − Pk .


Since the x and y components of the control points of ẽ(t) are of alternating sign, it is clear from
(12.31) that the x and y components of the differences ∆r ẽk are all of the same sign for r = 1, . . . , n.
Thus, the x and y components of all derivatives of ẽ(t) have the same sign when t lies outside the
unit interval, and the magnitude of ẽ(t) grows monotonically for t < 0 or t > 1.
Interval arithmetic has a bad reputation for interval width inflation. That is, it often occurs
when dealing with interval arithmetic that the widths of the intervals “balloon” so rapidly that the
practical value of the interval technique is seriously impaired. For example, interval operations are
generally not reversible:
([1, 2] + [3, 4]) − [3, 4] = [0, 3]. (12.33)

Thus, it is noteworthy that ballooning does not occur with the de Casteljau algorithm when applied
within the unit parameter interval. Even after repeated applications of the de Casteljau algorithm
to an interval Bézier curve, a point [ P ](t) evaluated on a subdivided region of the curve has the
same size as the given point evaluated on the original curve, as long as the subdivision always occurs
within the [ 0, 1 ] parameter domain. However, equation (12.27) shows that serious interval inflation
will occur when subdividing outside the unit interval.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
136 Interval Bézier curves

12.2.4 Envelopes of interval Bézier curves


At first sight, it may seem that making the transition from interval polynomials of the form (12.6)
to interval curves of the form (12.15) is a straightforward matter. However, a number of subtle
difficulties arise that deserve attention. It should be noted, for example, that while the bounds on
the scalar–valued interval polynomial (12.6) are readily expressible as the two polynomials (12.9),
the boundary of the area defined by an interval Bézier curve is not (in general) describable by just
two polynomial Bézier curves. That boundary is actually the envelope of the continuum of rectangles

[ x ](t)×[ y ](t) for t ∈ [ 0, 1 ] , (12.34)

where [ x ](t) and [ y ](t) are the interval–polynomial components of (12.15).


The region of the plane covered by an interval Bézier curve is actually bounded by Bézier curves
and by straight line segments. Consider, for example, the interval Bézier curve in Figure 12.6. There

Figure 12.6: The envelope of an interval Bézier curve.

are four possible Bézier curves involved in the envelope for a curve over the unit parameter interval.
Those four curves are defined by the four respective rectangle corners of the interval control points.
If the center curve [ P ](t) is progressing NE or SW, the upper envelope bound is defined by
control points lying in the top left corner of their respective intervals, and the lower envelope bound
is defined by control points lying in the bottom right corner of their respective intervals. Likewise, a
curve progressing NW or SE is bounded from above by a curve whose control points lie in top right
corners, and from beneath by a curve whose control points lie in bottom left corners. In the case of
a horizontal or vertical tangency, straight line segments are introduced into the envelope, equal in
width to twice the interval error at the point of tangency.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Approximation by interval polynomials 137

Thus, we can represent the boundary of the region covered by an interval Bézier curve as a
piecewise–Bézier curve of the same degree. Any linear segments that arise in this boundary due to
points of horizontal or vertical tangency can be degree–elevated if desired, making the representation
of the envelope compatible with standard spline formats.

12.2.5 Interval hodographs


The hodograph of a Bézier curve is simply the first derivative of that curve. The hodograph is itself
expressible as a Bézier curve of degree one less than the given curve. If {Pk } are the control points
of a Bézier curve of degree n, the control points of the hodograph are n∆Pk = n(Pk+1 − Pk ) for
k = 0, . . . , n − 1 [B8́6].
We can readily extend this notion to interval Bézier curves, although some caution must be
exercised in how the hodograph of an interval Bézier curve is to be interpreted. If the given interval
Bézier curve (with control points [ Pk ]) is taken to define the set of all Bézier curves with fixed
control points satisfying Pk ∈ [ Pk ], then the hodograph control points can correctly be computed
by simply differencing the control points of the original interval Bézier curve. Thus, a point [ P0 ](t)
on the hodograph defines bounds on the tangent vector for any curve for which Pk ∈ [ Pk ].
However, in some applications a given curve is represented by allowing control points to move
about as a function of t, within the interval. For example, in [SK91] it was shown that a rational
curve can be represented as a polynomial curve for which one of the control points is a rational
curve. That “moving control point” can be replaced by an interval which bounds its movement, but
the afore–mentioned hodograph does not correctly bound the derivative of the rational curve. The
reason is that the moving control point itself moves as a function of t, and therefore the product
rule must be applied to correctly represent the derivative of the curve.

12.3 Approximation by interval polynomials


Before proceeding to vector (curve) approximations, it will be convenient to discuss the approxima-
tion of scalar functions by interval polynomials expressed in Bernstein form.
Let the function f (t) be differentiable n + 1 times on the interval [ a, b ], and let

a ≤ t0 < t1 < · · · < tn ≤ b (12.35)

be an ordered sequence of n + 1 distinct points on that interval. The Lagrange interpolant to the
sampled values fk = f (tk ), k = 0, 1, . . . , n of f (t) at these points is the unique polynomial of degree
n given by
X n
Fn (t) = fk Lk (t) , (12.36)
k=0
where the n + 1 linearly independent polynomials
n
Y t − tj
Lk (t) = for k = 0, . . . , n (12.37)
t − tj
j=0 k
j6=k

constitute the Lagrange basis for the sequence of nodes t0 , t1 , . . . , tn . Since the basis polynomials
(12.37) satisfy the conditions (
1 if j=k,
Lk (tj ) = δjk = (12.38)
0 otherwise,

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
138 Approximation by interval polynomials

for each j = 0, . . . , n and k = 0, . . . , n it is clear that the polynomial Fn (t) reproduces the values of
the function f (t) at each of the nodes: Fn (tk ) = fk for k = 0, . . . , n.

12.3.1 Remainder formulae and interval approximants


At any other point on [ a, b ], however, the values of Fn (t) and f (t) disagree in general. Thus, we
define the error En (t) of the Lagrange interpolant by

En (t) = f (t) − Fn (t) , (12.39)

and if we have information on the behavior of the derivative f (n+1) (t) over the interval [ a, b ], we
may express (12.39) by the Cauchy remainder formula [Dav63]:
n
f (n+1) (ξ) Y
En (t) = (t − tk ) for some ξ ∈ (a, b) . (12.40)
(n + 1)!
k=0

Although, for each t, the value ξ at which the right hand side of (12.40) gives the error En (t) of the
Lagrange interpolant is not easily determined, if we know upper and lower bounds on f (n+1) (t) over
[ a, b ],
(n+1)
fmin ≤ f (n+1) (t) ≤ fmax
(n+1)
for all t ∈ (a, b) (12.41)
then we may write
(n+1) (n+1) n
[ fmin , fmax ] Y
f (t) ∈ Fn (t) + (t − tk ) , (12.42)
(n + 1)!
k=0

where the right hand side is regarded as an interval polynomial [ Fn+1 ](t) of degree n + 1.
In the particular form (12.42), only the remainder term has a non–degenerate interval coefficient,
but if we choose to represent this interval polynomial in another basis — for example, as
n+1
n + 1 (b − t)n+1−k (t − a)k
X  
[ Fn+1 ](t) = [ ak , bk ] (12.43)
k (b − a)n+1
k=0

in the Bernstein basis of degree n + 1 on [ a, b ] — we would find that in general each coefficient
[ ak , bk ] is a proper interval of finite width. The formulae giving the interval coefficients of (12.43)
in terms of the nodes (12.35), the function values f0 , f1 , . . . , fn at those nodes, and the derivative
bounds (12.41) for f (t) on [ a, b ] are cumbersome to quote in full generality; we shall give explicit
formulae below only for the simpler cases of practical interest.

12.3.2 Hermite interpolation


Hermite interpolation is another useful means of polynomial approximation. In general this involves
the interpolation of the values and derivatives of f (t) at specified points. Informally, we may regard
Hermite interpolation as a limiting form of Lagrange interpolation in which a sequence m + 1
consecutive nodes
tk , tk+1 , . . . , tk+m+1 (12.44)
are allowed to merge; then Fn (t) would be required to match the value f (tk ) and first m derivatives

f 0 (tk ), f 00 (tk ), . . . , f (m) (tk ) (12.45)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Approximation by interval polynomials 139

of f (t) at tk (i.e., Fn (t) has an m–fold osculation to f (t) at tk ).


In particular, suppose that t0 , t1 , . . . , tr is a monotone sequence of r + 1 distinct nodes, and we
associate non–negative integers m0 , m1 , . . . , mr with these nodes, such that m0 +m1 +· · ·+mr +r = n.
Then the unique polynomial Fn (t) that satisfies the interpolation problem
Fn(i) (tk ) = f (i) (tk ) for i = 0, . . . , mr and k = 0, . . . , r , (12.46)
(0)
where f (0) (t) ≡ f (t) and Fn (t) ≡ Fn (t), has the remainder term
r
f (n+1) (ξ) Y
En (t) = f (t) − Fn (t) = (t − tk )mk +1 . (12.47)
(n + 1)!
k=0

From the above, we can write down an expression analogous to (12.42), namely
(n+1) (n+1) r
[ fmin , fmax ] Y
f (t) ∈ Fn (t) + (t − tk )mk +1 . (12.48)
(n + 1)!
k=0

The interval–valued error term on the right has the same coefficient as in (12.43), but its dependence
on t is different.
An important instance of the general Hermite problem (12.46) is the symmetric interpolation of
values and derivatives to order (n − 1)/2 of a function f (t) at the end–points of the unit interval
[ 0, 1 ] by a polynomial Fn (t) of odd degree n,
Fn(i) (0) = f (i) (0) and Fn(i) (1) = f (i) (1) for i = 0, . . . , (n − 1)/2 . (12.49)
If we define the Hermite basis {Hkn (t)} of odd degree n on [ 0, 1 ] by demanding that the boundary
conditions
d j Hkn d j Hn−k
n

= = δjk (12.50)

dt j dt j
t=0

t=1
be satisfied for j, k = 0, . . . , (n − 1)/2 (where δjk is the Kronecker symbol given by (12.38) above),
we can write down the solution to (12.49) in the form
(n−1)/2
X
Fn (t) = f (k) (0)Hkn (t) + f (k) (1)Hn−k
n
(t) . (12.51)
k=0

The remainder term (12.40) in this case becomes


f (n+1) (ξ) (n+1)/2
En (t) = t (t − 1)(n+1)/2 . (12.52)
(n + 1)!
For example, the cubic Hermite basis on [ 0, 1 ] is given by
H03 (t) = 2t3 − 3t2 + 1 , H13 (t) = t3 − 2t2 + t ,
H23 (t) = t3 − t2 , H33 (t) = −2t3 + 3t2 , (12.53)
and plays an important rôle in the construction of cubic splines [dB78].
We now consider some simple special cases. Let the function f (t) be twice differentiable on the
interval [ 0, 1 ], and let f0 = f (0) and f1 = f (1) be its end–point values on that interval. The linear
interpolant to these values is just
F1 (t) = f0 (1 − t) + f1 t , (12.54)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
140 Approximation by interval polynomials

and we may write


f 00 (ξ)
f (t) = F1 (t) + t(t − 1) for some ξ ∈ (0, 1) . (12.55)
2
Thus, if the second derivative f 00 (t) is confined to the interval

[ f 00 ] = [ fmin
00 00
, fmax ], (12.56)

for all t ∈ [ 0, 1 ], we have

[ f 00 ]
f (t) ∈ F1 (t) − t(1 − t) for all t ∈ [ 0, 1 ] . (12.57)
2
In order to formulate the above as a quadratic interval polynomial [ F2 (t) ], we degree–elevate (12.54)
by multiplying the right hand side by 1 = (1 − t) + t to obtain
2
X
f (t) ∈ [ F2 ](t) = [ F2,k ] Bk2 (t) (12.58)
k=0

where
2f0 + 2f1 − [ f 00 ]
[ F2,0 ] = f0 , [ F2,1 ] = , [ F2,2 ] = f1 . (12.59)
4
Thus, in the case of a linear end–point interpolant, we see that the resulting quadratic interval
polynomial bounds f (t) on [ 0, 1 ] from below and above by the parabolas

2f0 + 2f1 − fmax


00
F2,min (t) = f0 B02 (t) + B12 (t) + f1 B22 (t) ,
4
2f0 + 2f1 − fmin
00
F2,max (t) = f0 B02 (t) + B12 (t) + f1 B22 (t) . (12.60)
4
For the case of cubic Hermite interpolation to the function values f0 , f1 and derivatives f00 , f10 at
the end–points of [ 0, 1 ], the Bernstein–Bézier form of the interpolant is

3f0 + f00 3 3f1 − f10 3


F3 (t) = f0 B03 (t) + B1 (t) + B2 (t) + f1 B33 (t) . (12.61)
3 3
(4) (4)
Thus, if the fourth derivative lies within the interval [ f (4) ] = [ fmin , fmax ] for all t ∈ [ 0, 1 ], we may
write
4
[ f (4) ] 2 X
f (t) ∈ F3 (t) + t (t − 1)2 = [ F4,k ] Bk4 (t) = [ F4 ](t) , (12.62)
24
k=0

where the coefficients of the quartic interval polynomial on the right are given by
1
[ F4,0 ] = f0 , [ F4,1 ] = f0 + f00 ,
4
1 1 1
[ F4,2 ] = (f0 + f1 ) + (f00 − f10 ) + [ f (4) ] ,
2 6 144
1
[ F4,3 ] = f1 − f10 , [ F4,4 ] = f1 . (12.63)
4
It should be noted that in all cases of symmetric Hermite interpolation of function values
and derivatives to order (n − 1)/2 at the end points of an interval, only the middle coefficient

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Approximation by interval polynomials 141

[ Fn+1,(n+1)/2 ] of the interpolating interval polynomial [ Fn+1 ](t) has non–zero width, since the
residual (12.52) contributes only to the term involving the basis function B(n+1)/2
n+1
(t). The width of
this middle coefficient is just
(n+1) (n+1)
fmax − fmin
2 . (12.64)
(n + 1) n · · · 21 (n + 3)
Note also that for end–point Hermite interpolation, the width of the interval polynomial [ Fn+1 ](t)
always degenerates to zero at t = 0 and t = 1.
Example 1. With f (t) = et we have f (0) = f 0 (0) = 1, f (1) = f 0 (1) = e, and f (4) (t) ∈ [ 1, e ] for
t ∈ [ 0, 1 ]. The interval control points (12.63) of the Hermite interpolant reflecting these values are
then:
5 1
[ F4,0 ] = 1 , [ F4,1 ] = , [ F4,2 ] = [ 97 + 48e, 96 + 49e ] , (12.65)
4 144
3
e , [ F4,4 ] = e .
[ F4,3 ] =
4
We can gain a better idea of the width of the middle control point from the approximate form
[ F4,2 ] ≈ [ 1.5797, 1.5916 ]. From (12.10) we now see that the overall width of the approximant
[ F4 ](t) over [ 0, 1 ] is (e − 1)/720 ≈ 0.0024. Thus, the upper and lower bounds on f (t) = et deviate
by no more than 1 per cent over the entire interval [ 0, 1 ], and on average much less than this.
Example 2. With f (t) = sin(πt/2) we have f (0) = 0, f 0 (0) = π/2, f (1) = 1, f 0 (1) = 0, and
f (4) (t) ∈ [ 0, π 4 /16 ] for t ∈ [ 0, 1 ]. In this case, we have

π 1
[ F4,0 ] = 0 , [ F4,1 ] = , [ F4,2 ] = [ 192(6 + π), 192(6 + π) + π 4 ] , (12.66)
8 2304
[ F4,3 ] = 1 , [ F4,4 ] = 1 .
and the interval–valued coefficient is approximately [ F4,2 ] ≈ [ 0.7618, 0.8041 ]. The overall width of
[ F4 ](t) over [ 0, 1 ] is now π 4 /11520 ≈ 0.0085, somewhat larger than in the preceding example.

12.3.3 Estimating bounds on derivatives


If the function f (t) to be approximated on [ 0, 1 ] is actually a polynomial, we can appeal to its
Bernstein–Bézier form,
n
X
f (t) = pk Bkn (t) , (12.67)
k=0

to obtain the derivative bounds required by the approximation procedure. We recall that the r–th
derivative of f (t) can be written as
n−r
n! X
f (r)
(t) = ∆r pk Bkn−r (t) , (12.68)
(n − r)!
k=0

and by the convex hull property we then have

n! n!
min ∆r pk ≤ f (r) (t) ≤ max ∆r pk for t ∈ [ 0, 1 ] . (12.69)
(n − r)! k (n − r)! k

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
142 Approximation by interval Bézier curves

12.4 Approximation by interval Bézier curves


For brevity we restrict our discussion in this paper to the approximation of plane curves; the ex-
tension to three dimensions is straightforward. Much of the preceding discussion concerning the
interpolation of values sampled from scalar functions applies also to the interpolation of vector–
valued functions, i.e., parametric curves. There is, however, an important difference regarding the
interpretation of the remainder term that deserves attention.
If P0 , P1 , . . . , Pn is a sequence of points corresponding to n + 1 distinct parameter values
t0 , t1 , . . . , tn on a plane parametric curve P(t) = {x(t), y(t)}, the Lagrange interpolant Pn (t) to
these points is simply
Xn
Pn (t) = Pk Lk (t) , (12.70)
k=0

where the Lagrange basis is as defined in (12.37) above. But the remainder formula in the vector case
is not obtained by merely substituting P(n+1) (ξ) in place of f (n+1) (ξ) in equation (12.40). Rather,
we must write the errors for the x and y components of Pn (t) = {Xn (t), Yn (t)} separately

En,x (t) = x(t) − Xn (t) and En,y (t) = y(t) − Yn (t) , (12.71)

and we then have


n n
x(n+1) (ξ1 ) Y y (n+1) (ξ2 ) Y
x(t) = Xn (t) + (t − tk ) and y(t) = Yn (t) + (t − tk ) (12.72)
(n + 1)! (n + 1)!
k=0 k=0

for some ξ1 , ξ2 ∈ (a, b), where ξ1 6= ξ2 in general. However, defining a vector–valued interval for
P(n+1) (t) over t ∈ [ a, b ] in the form
(n+1) (n+1)
[ P(n+1) ] = [ xmin , x(n+1)
max ] × [ ymin , ymax ]
(n+1)
(12.73)

allows us to express the remainder term as


n
[ P(n+1) ] Y
P(t) ∈ Pn (t) + (t − tk ) . (12.74)
(n + 1)!
k=0

In formulating interval–polynomial approximants to parametric curves, it is natural to consider


also piecewise interval polynomial forms, i.e., interval splines. This extension is not difficult, and we
will give here only a brief sketch of some of the pertinent ideas.
It is well known that a curvature–continuous piecewise–cubic curve can be constructed so as to
interpolate any ordered sequence of points P0 , P1 , . . . , Pn in the plane (which may or may not be
sampled from some other curve). Typically, constructing such a curve requires imposing appropriate
“end conditions” and then solving a tridiagonal system of linear equations for parametric derivatives
P00 , P01 , . . . , P0n to be assigned to the data points (see [dB78] or [Far90]). For each span k of the
spline curve, we then construct the cubic Hermite interpolant P(t) on t ∈ [ 0, 1 ] to the end–points
P(0) = Pk−1 , P(1) = Pk and end–derivatives P0 (0) = P0k−1 , P0 (1) = P0k ,

P(t) = P(0)H03 (t) + P0 (0)H13 (t) + P0 (1)H23 (t) + P(1)H33 (t) . (12.75)

If the data points P0 , P1 , . . . , Pn were actually sampled from another parametric curve r(t) and
we knew vector–valued bounds on the fourth derivative r(4) (t) between consecutive points, we could

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Approximation by interval Bézier curves 143

replace the cubic Hermite arcs (12.75) by quartic interval Bézier arcs of the form
4
X
[ P ](t) = [ P4,k ] Bkn (t) (12.76)
k=0

with control points given by


1
[ P4,0 ] = P(0) , [ P4,1 ] = P(0) + P0 (0) ,
4
1 1 0 1
[ P4,2 ] = (P(0) + P(1)) + (P (0) − P0 (1)) + [ P(4) ] ,
2 6 144
1
[ P4,3 ] = P(1) − P0 (1) , [ P4,4 ] = P(1) . (12.77)
4
At each of the data points P0 , P1 , . . . , Pn the width of the interval spline shrinks to zero.

Example 3. A quarter circle, P(t) = (cos πt 2 , sin 2 ), can be approximated as a quartic interval
πt

Bézier using the coefficients expressed in equation (12.67):


π
[ P4,0 ] = (1, 0); [ P4,1 ] = (1,
); [ P4,2 ] = ([0.7618, 0.8041], [0.7618, 0.8041]); (12.78)
8
π
[ P4,3 ] = ( , 1); [ P4,4 ] = (0, 1) .
8
While a quarter circle can be expressed exactly as a rational curve, the current approximation

P4,1
P4,0

[P4,2]

P4,3

P X
Figure 12.7: Approximate arc length parametrization of circle.

is useful because it approximates an arc length parametrization of the circle within two digits of
accuracy.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
144 Approximation by interval Bézier curves

In practice, one might simply choose the middle control point to be at the interval center [ P4,2 ] =
(0.78295, 0.78295), and use the control point interval as an assurance that the largest possible error,
which occurs at t = 0.5, is
  4
4 0.8041 − 0.7618 1
 
= 0.0079. (12.79)
2 2 2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 13

Floating Point Error

Most scientific computing is performed in floating point arithmetic in the binary number system.
For our discussion, consider the floating point number represented using 32 bits of memory, with
d = 23 bits of fraction and 8 bits of exponent

sign exponent fraction


{ z }| {
b= s | (13.1)
z}|{ z }|
es e7 e6 e5 e4 e3 e2 e1 e0 | f1 f2 f3 f4 . . . f21 f22 f23 .
|{z}
exponent sign

This string of 32 bits serve as sort of a “code” for representing numbers using the base 2 number
system. The decoding formula is to
" d #(−1)es P j=06 ej 2j
X
b = (−1)s f e = (−1)s fi 2−i . (13.2)
i=1

For example,

0|000000100|11010000000000000000000 = .11012 × 24 = 11012 = 13

1 1 1 7
0|100000001|11100000000000000000000 = .1112 × 2−1 = .01112 = + + =
4 8 16 16
1
1|000000100|10011000000000000000000 = −.100112 × 24 = −1001.12 = −9
2
One limitation of this floating point number system is that not every number can be represented
exactly. For example, the number 13 is a repeating decimal in the binary number system:

1 ¯2
= 0.010101
3

and thus there is no floating point number which exactly equals 31 . It lies between the two adjacent
floating point numbers

1
0|100000001|10101010101010101010101 < < 0|100000001|10101010101010101010110
3

145
146

Therefore, a floating point number is best thought of as an interval which contains all numbers which
are closer to it than to any other floating point number. If d is the number of bits in the fraction of
a given floating point number b, then that interval is

[b] = [b(1 − 2−(d+1) ), b(1 + 2−(d+1) )] = b[1 − 2−(d+1) , 1 + 2−(d+1) ]. (13.3)

This chapter discusses the floating point error incurred in evaluating a Bézier curve. Figure 13.1
shows a Bézier curve which is tangent to the horizontal axis at t = 0.25. Due to numerical innacu-
racies in floating point arithmetic, it is not surprising that when the curve is evaluated at t = .25
(using either the de Casteljau algorithm or Horner’s method) the answer is not exactly zero. It
is interesting to note what happens when we evaluate the curve at several hundred values close to
t = 0.25. Rather than a producing a smooth graph, the evaluations fluctuate chaotically within a
band, as shown in the blowup in figure 13.1.

x=0.25
.0001

.0000001

c2=9

c0=1

c1=-3
x=0.25

1
27

c3=-27

Figure 13.1: Affine map in floating point.

So, how does one determine the effects of floating point error on calculations involving Bézier

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
147

curves?
Two sources of error can be considered somewhat independently. The first source of error is in
the initial floating point representation of the control points. First
Our previous discussions on interval Bézier curves should be modified slightly if one wishes to
accurately bound the uncertainty introduced when using finite–precision arithmetic. Let us first
revisit the problem of computing the affine map of two vector intervals shown in Figure 12.4. When
finite precision arithmetic is involved, some uncertainty is introduced. In order to robustly represent
that uncertainty, the resulting interval should be widened an appropriate amount (t)[i] as shown in
Figure 13.2. Here, the affine map for t = 12 is shown with the exact arithmetic in solid and floating
point error bounds in dashed line.

[P1]

(1-t)[P0 ]+t[P1 ]

[P0 ]

Figure 13.2: Affine map in floating point.

Given a floating point mantissa of d binary digits, the machine unit for roundoff is

η = 2−d . (13.4)

If x ∗ y, where ∗ ∈ {+, −, ×, ÷}, denotes an exact computation, and fl(x ∗ y) denotes the floating
point, imprecise computation, then

fl(x ∗ y) ∈ x ∗ y [1 − η, 1 + η] = x ∗ y (1 + η[i]). (13.5)

Applying this to the affine map equation 12.26 yields (see equation 26 in [FR87])

fl[ M ](p0 + e0 [ i ], p1 + e1 [ i ], t) ∈ [ M ](p0 + e0 [ i ], p1 + e1 [ i ], t) + (t) (13.6)

where
 {|p0 |(1 − t) − |p1 |t + |p0 (1 − t) + p1 t|} η [ i ] for t < 0 ,

(t) = {|p0 |(1 − t) + |p1 |t + |p0 (1 − t) + p1 t|} η [ i ] for 0 ≤ t ≤ 1 , (13.7)


{|p0 |(t − 1) + |p1 |t + |p0 (1 − t) + p1 t|} η [ i ] for t > 1 ,

= {|1 − t||p0 | + |t||p1 | + |p0 (1 − t) + p1 t|} η [ i ] . (13.8)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
148

In words, to represent the effects of floating point roundoff in computing an affine map, the
rectangle obtained by computing the affine map in exact arithmetic must be fattened an absolute
amount (t).
Additional discussion on the error propagation in operations on Bernstein–form polynomials can
be found in [FR87].

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 14

Free-Form Deformation (FFD)

Free-form deformation (FFD) is a technique for manipulating any shape in a free-form manner.
Pierre Bézier used this idea to manipulate large numbers of control points for Béziersurface patches [B7́4,
B7́8], and the power of FFD as a modeling tool was more fully explored in [SP86b]. This chapter
discusses the 2D case of FFD.

Figure 14.1: FFD example

Figure 14.2: FFD example

2D FFD is a map from R2 → R2 ; that is, it defines a new position for every point in a given rect-
angular region. In Figure 14.1, the FFD is specified using the nine control points. The undeformed

149
150

scene appears at the left, and the right shows what happens the the grid and circle after the control
points are moved. The grid helps to visualize how FFD works. FFD is a powerful modeling tool
because anything drawn inside of the initial, undeformed rectangle will experience the distortion,
such as the text in Figure 14.2.
Denote by (Xmin , Ymin ) and (Xmax , Ymax ) the corners of a deformation region, and by m and
n the degrees of the FFD function (there are m + 1 vertical columns and n + 1 horizontal rows of
control points).
FFD is a two-step process:
1. Compute the (s, t) coordinates for each point to be deformed. The s and t coordinates of a
point in the deformation region range between 0 and 1 (see Figure 14.3). For a point in the

(Xmax ,Ymax)
P = (x,y)
s=.6

t =.7

(Xmin ,Ymin)

Figure 14.3: FFD local coordinates

rectangular region whose Cartesian coordinates are (x, y),


x − Xmin y − Ymin
s= , t= . (14.1)
Xmax − Xmin Ymax − Ymin

2. Compute the homogeneous coordinates X(s, t) = (X, Y, W ) of the deformed point using the
rational bivariate tensor product Bernstein polynomial equation
n X
X m
X(s, t) = Bim (s)Bjn (t)Pij (14.2)
j=0 i=0

where Bin (t) and Bjm (s) are Bernstein polynomials and Pij = wij (xij , yij , 1) are the homoge-
neous coordinates of the displaced control point i, j. Note that weights can be assigned to the
FFD control points.
If all weights wij = 1 and if the control points form a rectangular lattice
 
i j
Pi,j = Xmin + (Xmax − Xmin ), Ymin + (Ymax − Ymin ) (14.3)
m n
as shown in Figure 14.4, FFD is the identity transformation: all points end up where they started
from.
Points outside of the rectangle are not moved. If a shape is only partially inside the FFD region,
one can control the degree of continuity between the deformed and undeformed portions of the shape
by “freezing” rows of control points, as shown in Figure 14.5.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
151

P0,2 P1,2 P2,2 P3,2

P0,1 P1,1 P2,1 P3,1

P0,0 P1,0 P2,0 P3,0

Figure 14.4: FFD undisplaced control points

Initial C0

C1 C2

Figure 14.5: Continuity control

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
152

14.0.1 Deformed Lines

Each vertical line that undergoes FFD maps to a Bézier curve of degree n, and each horizontal line
maps to a Bézier curve of degree m. Thus, the “vertical” curves in Figure 14.6.b are degree-two
Bézier curves and the “horizontal” curves are degree three. In particular, we have highlighted the

s=.6
(a) Undeformed Grid with un-displaced control points. (b) Deformed Grid.

Figure 14.6: FFD Applied to a Grid of Lines.

line s = .6 in Figure 14.6.a and its deformation is the degree-two Bézier curve shown in Figure 14.6.b.
The control points for this Bézier curves are determined as follows.
Referring to Figure 14.7, consider each horizontal row of control points in the FFD control grid
to be a control polygon for a cubic Bézier curve. Call these curves H0 (s), H1 (s), and H2 (s) where
the control points for Hi (s) are P0,i , P1,i , P2,i , P3,i . Then, the three control points for the

H2(.6)

H2(s)

H1(s) H1(.6)

H0(.6)

H0(s)

Figure 14.7: Control points of deformed line.

degree-two Bézier curve in Figure 14.6.b are H0 (.6), H1 (.6), and H2 (.6).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
153

t=.3

(a) Undeformed Grid with horizontal line at t = .3. (b) Deformed Grid.

Figure 14.8: FFD Applied to a horizontal line t = .3

The horizontal line t = .3 is highlighted in Figure 14.8.a and its deformation is the degree-three
Bézier curve shown in Figure 14.8.b. The control points for this Bézier curves are determined as
follows.
Referring to Figure 14.9, consider each vertical column of control points in the FFD control grid
to be a control polygon for a quadratic Bézier curve. Call these curves V0 (s), V1 (s), V2 (s), and
V3 (s) where the control points for Vi (s) are Pi,0 , Pi,1 , Pi,2 . Then, the four control points for

V1(t) V2(t)

V3(t)
V0(t) V2(.3)
V1(.3)

V3(.3)
V0(.3)

Figure 14.9: Control points of deformed line.

the degree-three Bézier curve in Figure 14.9.b are V0 (.3), V1 (.3), V2 (.3), and V3 (.3).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
154

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 15

TENSOR-PRODUCT SURFACES

The product of a column vector and a row vector is an example of the mathematical operation of
tensor-product:
   
a0 a0 b0 a0 b1 a 0 b2 a0 b3
 a1  ⊗ b0 b1 b2 b3 =  (15.1)
 
a1 b0 a1 b1 a 1 b2 a1 b3 
a2 a2 b0 a2 b1 a 2 b2 a2 b3

A tensor-product surface P(s, t) is one whose blending functions are products of pairs of uni-
variate blending functions:
Pm Pn
j=0 wij Pij Bi (s)Bj (t)
m n
i=0
P(s, t) = Pm Pn (15.2)
j=0 wij Bi (s)Bj (t)
m n
i=0

where the Pij are control points, wij are weights, and Bim (s) and Bjn (t) are univariate blending
functions. The control points in a tensor-product surface are organized topologically into a rectan-
gular array, and the blending functions corresponding to the control points are likewise organized in
an array similar to the one in (15.1).
Tensor-product surfaces can be constructed from any two types of univariate blending functions,
and there is no requirement that the two sets of blending functions are of the same type or degree.
If the univariate blending functions are Bernstein polynomials, the surface is a Bézier surface patch
(see Section 15.1). If the blending functions are B-Splines, the surface is a NURBS surface (see
Section 15.6).

15.1 Tensor-Product Bézier Surface Patches


For a Tensor-Product Bézier surface patch, m and n in (15.2) are the degrees of the respective
Bernstein polynomials. If m = n = 3, the surface is called a “bi-cubic” patch Likewise, the case
m = n = 2 is called “bi-quadratic,” m = n = 1 is called “bi-linear,” etc. If m 6= n, we normally just
say that the surface is degree m × n.
Figure 15.1.a shows a tensor-product Bézier surface patch of degree 2 × 3. Note that the (m +
1) × (n + 1) control points that are organized topologically into m + 1 “rows” and n + 1 “columns.”
The control points along with the blue lines connecting them in Figure 15.1.a is called the control
grid or control mesh of the surface (analogous to the control polygon for a curve). The control points

155
156 Tensor-Product Bézier Surface Patches

for a bicubic patch are organized as follows:

P03 P13 P23 P33


 
 P02 P12 P22 P32 
 P01 (15.3)
P11 P21 P31 
 

P00 P10 P20 P30

The corresponding blending functions are

(1 − s)3 · t3 3s(1 − s)2 · t3 3s2 (1 − s) · t3 s3 · t3


 
 (1 − s)3 · 3t2 (1 − t) 3s(1 − s)2 · 3t2 (1 − t) 3s2 (1 − s) · 3t2 (1 − t) s3 · 3t2 (1 − t) 
 (1 − s)3 · 3t(1 − t)2 3s(1 − s)2 · 3t(1 − t)2 3s2 (1 − s) · 3t(1 − t)2 (15.4)
s3 · 3t(1 − t)2 
 

(1 − s)3 · (1 − t)3 3s(1 − s)2 · (1 − t)3 3s2 (1 − s) · (1 − t)3 s3 · (1 − t)3

Each row and column of control points can be interpreted as defining a curve. We will refer to the
curve defined by control points Pij , j = 0, 1, . . . n as the ith s-control curve and the curve defined by
control points Pij , i = 0, 1, . . . m as the j th t-control curve. Thus, there are m + 1 s-control curves,
and n + 1 t-control curves. (The term “control curve” is not in standard use; it is a helpful concept,
but is not used outside of these notes.)
If we fix one of the two parameters of the surface (for example, let s = c) then (15.2) reduces to
n
"m # n
X X X
P(c, t) = Pij Bi (c) Bjn (t) =
m
Qj (c)Bjn (t) (15.5)
j=0 i=0 j=0
Pm
where Qj (c) = i=0 Pij Bim (c). P(c, t) is called an s-iso-parameter curve. Iso means constant, and
an iso-parameter curve is a curve on a surface defined by holding one of the parameters constant.

P32
P22 Q2(c) Q1(c)
P31
P12 P21 Q2(c)
P11 Q1(c)
c=1
P02 P30
.6 .8
P01 .4
.2
c=0
t P20
s Q0(c)
P00 P10 Q0(c)

(a) The surface and its control grid. (b) s-Control Curves. (c) Some s-iso-parameter curves
P(c, t).

Figure 15.1: Bézier surface patch of degree 2 × 3.

A surface can be thought of as a family of iso-parameter curves, and the construction of those
iso-parameter curves can be easily described in terms of control curves. Figure 15.1.b shows the
s-control curves for the surface in Figure 15.1.a. Imagine that these control curves are wires, and
imagine that a bead is free to slide along each wire. These beads serve as control points for the family
of s-iso-parameter curves. That is, for a fixed value c, if we position each bead j at Qj (c), they
define the Bézier control point positions for s-iso-parameter curve P(c, t). Figure 15.1.c shows six
such iso-parameter curves. Of course, P(s, t) can likewise be viewed as a family of t-iso-parameter
curves defined by t-control curves, as illustrated in Figure 15.2.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
The de Casteljau Algorithm for Bézier Surface Patches 157

(a) t-Control curves. (b) Some t-iso-parameter curves P(s, c) for the sur-
face in Figure 15.1.a.

Figure 15.2: Surface in Figure 15.1.a viewed as a family of t-iso-parameter curves.

In general, the only control points that lie on a Bézier surface patch are the corners:

P(0, 0) = P00 , P(1, 0) = Pm0 , P(0, 1) = P0n , P(1, 1) = Pmn .

To evaluate the point P(σ, τ ), we could first evaluate the t-control curves at t = τ , and then
evaluate the t-iso-parameter curve at s = σ. Alternatively, we could first evaluate the s-control
curves at s = σ, and then evaluate the s-iso-parameter curve at t = τ .
Four special iso-parameter curves are the boundary curves P(0, t), P(1, t), P(s, 0), and P(s, 1).
These boundary curves are Bézier curves defined by the corresponding boundary rows or columns of
control points, and hence are control curves. For example, P(0, t) is the degree-three Bézier curve
whose control points are P00 , P10 , P20 , and P30 . Likewise, P(s, 1) is the degree-two Bézier curve
whose control points are P30 , P31 , and P32 .

15.2 The de Casteljau Algorithm for Bézier Surface Patches


Section 2.2 introduced the notation P[t0 ,t1 ] (t) to mean a curve defined over the domain t ∈ [t0 , t1 ].
In like manner, we will denote by
P[s0 ,s1 ]×[t0 ,t1 ] (s, t)
the surface defined over the domain s ∈ [s0 , s1 ], t ∈ [t0 , t1 ].
The de Casteljau algorithm can be used to cut a Bézier surface patch P[s0 ,s1 ]×[t0 ,t1 ] (s, t) into two
pieces, either in the s or t parameter directions. Cutting at s = σ would produce P[s0 ,σ]×[t0 ,t1 ] (s, t)
and P[σ,s1 ]×[t0 ,t1 ] (s, t). Cutting at t = τ would produce P[s0 ,s1 ]×[t0 ,τ ] (s, t) and P[s0 ,s1 ]×[τ,t1 ] (s, t).
To subdivide a Bézier surface patch at s = σ, simply apply the de Casteljau algorithm for curves
to subdivide each of the s-control curves at s = σ. To subdivide a Bézier surface patch at t = τ ,
subdivide each of the t-control curves at t = τ .
By repeated application of the de Casteljau algorithm, it is possible to obtain a patch over
any sub-domain. For example, the patch P[0, 21 ]×[0, 12 ] in Figure 15.3.c can be obtained by splitting
P[0,1]×[0,1] at t = 12 to obtain P[0,1]×[0, 12 ] and P[0, 12 ]×[ 12 ,1] , and then splitting P[0,1]×[0, 12 ] at s = 12 to
obtain P[0, 12 ]×[0, 12 ] and P[ 21 ,1]×[0, 21 ] .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
158 Tangents and Normals

t t t
s s s

(a) Subdivision in the s direction. (b) Subdivision in the t direction. (c) P[0, 1 ]×[0, 1 ] , obtained by sub-
2 2
dividing at s = 1
2
and then at
t = 21 .

Figure 15.3: Applying the de Casteljau algorithm to the surface in Figure 15.1.a.

The idea of control curves also leads to a straightforward explanation of how to degree elevate a
Bézier surface patch: simply degree elevate all of the s and/or t control curves.

15.3 Tangents and Normals


Tangent and normal vectors for a surface patch can be obtained by computing partial derivatives.
As with Bézier curves, it is easiest to compute derivatives at a corner of a Bézier surface patch.

P32
P22
P31
P12 P21
P11
P02 P30
P01
1
P
2 t P20
1
P
3 s
P00 P10

Figure 15.4: Partial derivative vectors for P[0,1]×[0,1] (s, t)(assuming weights are unity).

For a rational Bézier surface patch P[s0 ,s1 ]×[t0 ,t1 ] (s, t), the partial derivatives at corner P(0, 0)
are
m w10 n w01
Ps (s0 , t0 ) = (P10 − P00 ), Pt (s0 , t0 ) = (P01 − P00 )
s1 − s0 w00 t1 − t0 w00
These partial derivatives are illustrated in Figure 15.4. The second partial derivatives are given by

n(n − 1) w
w00 (P20 − P00 ) − 2n w00
20 w10 nw10 −w00
w00 (P10 − P00 )
Pss (s0 , t0 ) =
(s1 − s0 )2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Tessellation of Bézier Curves and Surfaces 159

w00 (P02 − P00 ) − 2n w00


n(n − 1) w02 w01 nw01 −w00
w00 (P01 − P00 )
Ptt (s0 , t0 ) =
(t1 − t0 )2
Letting P̂ij = Pij − P00 ,
mn
Pst (s0 , t0 ) = 2 (s − s )(t − t ) (w00 w11 P̂11 − w10 w01 P̂10 − w10 w01 P̂01 )
w00 1 0 1 0

A vector that is perpendicular to the surface at P(0, 0) can be obtained by taking the cross
product Ps (0, 0) × Pt (0, 0). To find the normal vector at any other point on the surface, you can
first perform de Casteljau subdivisions to move the desired point to a corner.

15.4 Tessellation of Bézier Curves and Surfaces


In computer graphics and geometric modeling, parametric curves and surfaces are often tessellated
into piecewise linear segments for various applications, like rendering, mesh generation, and sur-
face/surface intersection. A simple approach is to sample the curve or the surface evenly in its
domain and then properly connect the sampling points to form a polyline or a triangular mesh. In
this approach, the key point is to determine the sampling number. In the following we give for-
mulae to compute the appropriate sampling number(s) such that the deviation of the approximate
piecewise linear segments from the original curve or surface is within given tolerance .

15.4.1 The curve case


Section 10.6 derives the following result. Consider a degree n Bezier curve defined by
n
X
r(t) = Pi Bin (t), t ∈ [0, 1].
i=0

If L(t) is a straight line segment connecting r(α) and r(β) where 0 ≤ α < β ≤ 1, then the deviation
of L(t) from r(t) within domain [α, β] is bounded by (see Wang 1984, Filip et al 1986)

1
max kr(t) − L(t)k ≤ max kr00 (t)k(β − α)2 .
t∈[α,β] 8 t∈[α,β]

This provides a way to compute the parameter interval (or step size) δ given a tolerance :
 v
u 8
, if kr00 (t)k =
6 0


 u
max kr00 (t)k
t
δ≤ t∈[α,β]

1, otherwise

The sampling number nt is the reciprocal of the parameter interval, i.e., nt = d1/δe. That is, if the
curve is evenly sampled at nt + 1 parameter values, the final polyline will not deviate from the curve
greater than . In practice, the norm of the second derivative of r(t) can be bounded by the Bezier
control points:
max kr00 (t)k ≤ n(n − 1) max kPi+2 − 2Pi+1 + Pi k.
t∈[α,β] 0≤i≤n−2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
160 Tessellation of Bézier Curves and Surfaces

15.4.2 The surface case


For a surface r(s, t), (s, t) ∈ [0, 1]×[0, 1], we choose a sub-domain [α, β]×[ζ, η] and construct a piece-
wise linear function L(s, t) which consists of two triangles r(α, β)r(ζ, β)r(α, η) and r(ζ, η)r(α, η)r(ζ, β).
It has been proved that

1
max kr(s, t) − L(s, t)k ≤ (M1 (β − α)2 + 2M2 (β − α)(η − ζ) + M3 (η − ζ)2 )
(s,t)∈[α,β]×[ζ,η] 8

where
M1 = max 00
krss (s, t)k
(s,t)∈[α,β]×[ζ,η]
M2 = max 00
krst (s, t)k
(s,t)∈[α,β]×[ζ,η]
M3 = max 00
krtt (s, t)k.
(s,t)∈[α,β]×[ζ,η]

Given tolerance , we would like to determine the parameter intervals δs and δt for s− and t−directions
such that
M1 δs2 + 2M2 δs δt + M3 δt2 ≤ 8.

Case 1. If M1 p
= 0, the surface is a ruled surface (linear in s−direction). Then we choose δs = 1
M22 + 8M3  − M2
and δt = .
M3

Case 2. If M3 p
= 0, the surface is also a ruled surface (linear in t−direction). Then we choose δt = 1
M22 + 8M1  − M2
and δs = .
M1

Case 3. In general, the above inequality contains two unknowns δs and δt .rWe need to impose an
8
additional constraint to solve for them. Suppose δs = kδt . Then δt = .
M1 k + 2M2 k + M3
2

The default value for k is k = M3 /M1 .


p

The above choice for the value of k is to minimize the number of resulting triangles. The reasoning
is as follows. The sampling numbers ns and nt are the reciprocal of the parameter intervals δs and
δt , i.e., ns = d1/δs e and nt = d1/δt e. Thus the number of the triangles is 2ns nt . So we have to
choose k to maximize δs δt . Note that

8k
δs δt = .
M1 k 2 + 2M2 k + M3

This requires us to minimize M1 k + M3 /k, which gives a unique solution k = M3 /M1 . Now the
p

surface is sampled evenly at (ns + 1)(nt + 1) parameter values and the triangulation can be formed
by properly connecting the sampling points. In this way, it is guaranteed that the final triangle
mesh approximates the surface within the tolerance .
For a degree m × n Bezier patch
m X
X n
r(s, t) = Pij Bim (s)Bjn (t), s, t ∈ [0, 1]
i=0 j=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Tessellation of Bézier Curves and Surfaces 161

bounds on the norms of its second derivatives are given by:

M1 ≤ m(m − 1) max kPi+2,j − 2Pi+1,j + Pij k


0≤i≤m−2
0≤j≤n
M2 ≤ mn max kPi+1,j+1 − Pi+1,j − Pi,j+1 + Pij k
0≤i≤m−1 (15.6)
0≤j≤n−1
M3 ≤ n(n − 1) max kPi,j+2 − 2Pi,j+1 + Pij k.
0≤i≤m
0≤j≤n−2

Remark 1. When tessellating a few connecting patches, to avoid cracks, it is a good idea to compute
sampling number for all four boundary curves independently of the sampling numbers for the patch
interior (see Rockwood et al. 1989).
Remark 2. The above approach can also be applied to tessellating rational curves or surfaces. But
the estimation of the second derivative bounds is very difficult. A simple and efficient way has been
developed (see Zheng and Sederberg 2000).

Example
How many rows and columns of triangles are needed to tessellate the patch in Figure 15.5 using the
fewest number of triangles such that the approximation error  ≤ .001?

P0,3=(0,6,0) P1,3=(2,6,4) P2,3=(4,6,0) P3,3=(6,6,0)

P0,2=(0,4,2) P1,2=(2,4,6) P2,2=(4,4,6) P3,2=(6,4,2)

P0,1=(0,2,0) P1,1=(2,2,6) P2,1=(4,2,6) P3,1=(6,2,2)

P0,0=(0,0,0) P1,0=(2,0,4) P2,0=(4,0,4) P3,0=(6,0,0)

Figure 15.5: Surface Control Grid

Solution Using (15.6), compute bounds on second partial derivatives. In this example, the (x, y)
coordinates lie in a rectangular lattice, which means that the the (x, y) components of all second
partial derivatives are zero. The control points of the second hodographs for Pss , Pst and Ptt have

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
162 C n Surface Patches

z-coordinates as follows:

24
 
−48
0 −36 36
 
 
 −24 −24 −24 −12 −36 −12
Pss :  Pst :  −18 0 0  Ptt =

12 −12 −12 −12

 −36 −24
18 0 0

−24 −24

from which M1 = 48, M2 = 36, and M p3 = 36. This


√ is not a ruled surface, since M1 , M3 6= 0, so we
proceed to use Case 3. Solve for k = M3 /M1 = 3/2. Then
s
8 8 ∗ 0.001
r
δt = = √ √ = 0.00771649
M1 k 2 + 2M2 k + M3 48 ∗ ( 3/2)2 + 2 ∗ 36 ∗ 3/2 + 36

and δs = kδt = 0.00668268. The number of rows and columns of triangles is then

1 1
ns = d e = 150; nt = d e = 130.
δs δt

It should be noted that this equation for computing the number of triangles is conservative
because the bound on the second derivative may not be tight, and because the second derivatives
can vary dramatically across the patch. However, the equation does assure that if the specified
number of triangles is used, the tolerance will be satisfied.

References
Wang, G.-Z. 1984. The subdivision method for finding the intersection between two Bezier curves
or surfaces, Zhejiang University Journal: Special Issue on Computational Geometry, 108–119
(in Chinese).

Filip, D., Magedson,R. and Markot,R. 1986, Surface algorithms using bounds on derivatives, Com-
puter Aided Geometric Design 3, 295–311.

Rockwood,A.,Heaton,K.,and Davis,T. 1989. Real-time rendering of trimmed surfaces. SIGGRAPH


Comput.Graph. 23(3)(July 1989), 107-116.

Zheng, J. and Sederberg, T. 2000. Estimating tessellation parameter intervals for rational curves
and surfaces. ACM Transactions on Graphics 19(1), 56–77.

15.5 C n Surface Patches


As with Bézier curves, it is possible to piece together several individual Bézier surface patches to
create a more complicated surface. Figure 15.6 shows a classic model from computer graphics, the
Utah teapot. This teapot is modelled using 32 bicubic Bézier surface patches. For rendering, each
patch is divided into a 9 × 9 grid of rectangles, and rectangles on the border of a patch are split into
two triangles.
The conditions under which a pair of Bézier surface patches are C n are analogous to the conditions
for C n continuity of a pair of Bézier curves. Two tensor-product surface patches are C n if and only
if every pair of adjacent control curves are C n , as illustrated in Figure 15.7.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
NURBS Surface 163

Figure 15.6: Teapot modeled using 32 bicubic Bézier surface patches

(a) Two bicubic Bézier surface patches. (b) Each matching pair of control curves is C n .

Figure 15.7: Two C n bicubic Bézier surface patches.

15.6 NURBS Surface


It is not too difficult to construct a Bézier patch that is C n with a second Bézier patch. However,
it is creating a network of Bézier patches that are C n with each other is difficult for n > 1, because
the two families of control curves (one in each parameter direction) must be C n simultaneously.
This problem does not exist with B-Spline surfaces, because the control curves in both directions
are automatically C n .
A tensor-product NURBS surface is one for which the blending functions in (15.2) are B-Spline
blending functions. In order to define a NURBS surface, we must therefore specify a knot vector for
the s blending functions, and a second knot vector for the t blending functions.
The operations on NURBS curves such as knot insertion, finding the Bézier curves that comprise
a NURBS curve, etc., extend directly to NURBS surface: We simply operate on each of the control
curves. Thus, to insert a knot into the s knot vector for a NURBS surface, we insert the knot into
each s-control curve of the NURBS surface. Figure 15.9 shows a bicubic NURBS surface which first
undergoes a knot insertion in the t direction, and then in the s direction.
To split a NURBS surface into Bézier surfaces, we simply split each s-control curve into Bézier

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
164 T-Splines

(a) A NURBS surface and its con- (b) After inserting one knot in the (c) After inserting one knot in the
trol grid. t direction. s direction.

Figure 15.8: Knot insertions into a NURBS surface.

curves, and then split each resulting t-control curve into Bézier curves. The most efficient way to
evaluate a NURBS surface is to first split it into Bézier surfaces, then evaluate the Bézier surfaces.

(a) Inserting triple knots in the s (b) Inserting triple knots in the t (c) The Bézier surfaces, moved
direction. direction. apart.

Figure 15.9: Splitting a NURBS surface into Bézier patches.

15.7 T-Splines
A serious weakness with NURBS surfaces is that NURBS control points must lie topologically in a
rectangular grid. This means that typically, a large number of NURBS control points serve no pur-
pose other than to satisfy topological constraints. They carry no significant geometric information.
In Figure 15.10.a, all the red NURBS control points are, in this sense, superfluous.
T-splines are a generalization of NURBS surfaces that are capable of significantly reducing the
number of superfluous control points. Figure 15.10.b shows a T-spline control grid which was
obtained by eliminating the superfluous control points from the NURBS model. The main difference
between a T-mesh (i.e., a T-spline control mesh) and a NURBS control mesh is that T-splines allow
a row of control points to terminate. The final control point in a partial row is called a T-junction.
The T-junctions are shown in purple in Figure 15.10.b.
Figure 15.11 shows another example in which the superfluous control points in a NURBS are
removed to create a T-spline. The T-spline model is geometrically equivalent to the NURBS model,
yet has only 1/3 as many control points.
Superfluous control points are a serious nuisance for designers, not merely because they require
the designer to deal with more data, but also because they can introduce unwanted ripples in the
surface as can be seen by comparing the forehead in the NURBS model in Figure 15.12.a with that

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
T-Splines 165

Figure 15.10: Head modeled (a) as a NURBS with 4712 control points and (b) as a T-spline with
1109 control points. The red NURBS control points are superfluous.

Figure 15.11: Car door modeled as a NURBS and as a T-spline.

Figure 15.12: NURBS head model, converted to a T-spline.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
166 T-Splines

of the T-spline model in Figure 15.12.b. Designers can waste dozens of hours on models such as this
in tweaking the NURBS control points while attempting to remove unwanted ripples. Figure 15.10.a
shows a NURBS head model. Figure 15.10 shows the respective NURBS and T-spline control meshes
for the surfaces in Figure 15.12. Over 3/4 of the 4712 NURBS control points are superfluous and
do not appear in the T-spline control mesh.
T-splines can be used to merge non-uniform B-spline surfaces that have different knot-vectors.
Figure 15.13.a shows a hand model comprised of seven B-spline surfaces. The small rectangular area
is blown up in Figure 15.13.b to magnify a hole where neighboring B-spline surfaces do not match
exactly. The presence of such gaps places a burden on designers, who potentially must repair a
widened gap whenever the model is deformed. Figure 15.13.c shows the model after being converted
into a gap-free T-spline, thereby eliminating the need for repair.

(a) Model of a hand comprised of B-spline surfaces. (b) NURBS surfaces. (c) T-Spline.

Figure 15.13: A gap between two B-spline surfaces, fixed with a T-spline.

While the notion of T-splines extends to any degree, we restrict our discussion to cubic T-splines.
Cubic T-splines are C 2 in the absence of multiple knots.

15.7.1 Equation of a T-Spline


A control grid for a T-spline surface is called a T-mesh. If a T-mesh forms a rectangular grid, the
T-spline degenerates to a B-spline surface.
A T-mesh is basically a rectangular grid that allows T-junctions. The pre-image of each edge in
a T-mesh is a line segment of constant s (which we will call an s-edge) or of constant t (which we
will call a t-edge). A T-junction is a vertex shared by one s-edge and two t-edges, or by one t-edge
and two s-edges.
Knot information for T-splines is expressed using knot intervals, non-negative numbers that
indicate the difference between two knots. A knot interval is assigned to each edge in the T-mesh.
Figure 15.14 shows the pre-image of a portion of a T-mesh in (s, t) parameter space; the di and ei
denote the knot intervals. Knot intervals are constrained by the relationship that the sum of all
knot intervals along one side of any face must equal the sum of the knot intervals on the opposing
side. For example, in Figure 15.14 on face F1 , e3 + e4 = e6 + e7 , and on face F2 , d6 + d7 = d9 .
The knot intervals must obey the following requirements:

1. The sum of knot intervals on opposing edges of any face must be equal. Thus, for face F in
Figure 15.14, d2 + d6 = d7 and e6 + e7 = e8 + e9 .

2. If a T-junction on one edge of a face can be connected to a T-junction on an opposing edge


of the face (thereby splitting the face into two faces) without violating Rule 1, that edge must
be included in the T-mesh.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
T-Splines 167

e5
d0 P3
t5

e4
d7
e7 e9
t4
F e8 e3
e6 P2 d5
t3
d2 d6 d8
e2
P1 t2
e1
d1 d2 d3 d4
t1
e0
s1 s2 s3 s4 s5

Figure 15.14: Pre-image of a T-mesh.

Figure 15.15: Pre-image of a T-mesh.

It is possible to infer a local knot coordinate system from the knot intervals on a T-mesh. To
impose a knot coordinate system, we first choose a control point whose pre-image will serve as the
origin for the parameter domain (s, t) = (0, 0). For the example in Figure 15.15, we designate (s0 , t0 )
to be the knot origin.
Once a knot origin is chosen, we can assign an s knot value to each vertical edge in the T-mesh
topology, and a t knot value to each horizontal edge in the T-mesh topology. In Figure 15.15, those
knot values are labeled si and ti . Based on our choice of knot origin, we have s0 = t0 = 0, s1 = d1 ,
s2 = d1 + d2 , s3 = d1 + d2 + d3 , t1 = e1 , t2 = e1 + e2 , and so forth. Likewise, each control point has
knot coordinates. For example, the knot coordinates for P0 are (0, 0), for P1 are (s2 , t2 + e6 ), for
P2 are (s5 , t2 ), and for P3 are (s5 , t2 + e6 ).
The knot coordinate system is used in writing an explicit formula for a T-spline surface:
Pn
i=1 wi Pi Bi (s, t)
P(s, t) = P n , (15.7)
i=1 wi Bi (s, t)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
168 T-Splines

where Pi = (xi , yi , zi , wi ) are control points in P 4 whose weights are wi , and whose Cartesian
coordinates are w1i (xi , yi , zi ). Likewise, the Cartesian coordinates of points on the surface are given
by Pn
(x , y , z )B (s, t)
Pn i i i i
i=1
. (15.8)
i=1 wi Bi (s, t)

The blending functions in (15.7) are Bi (s, t) and are given by

Bi (s, t) = N [si0 , si1 , si2 , si3 , si4 ](s)N [ti0 , ti1 , ti2 , ti3 , ti4 ](t) (15.9)

where N [si0 , si1 , si2 , si3 , si4 ](s) is the cubic B-spline basis function associated with the knot vector

si = [si0 , si1 , si2 , si3 , si4 ] (15.10)

and N [ti0 , ti1 , ti2 , ti3 , ti4 ](t) is associated with the knot vector

ti = [ti0 , ti1 , ti2 , ti3 , ti4 ]. (15.11)

as illustrated in Figure 15.16. The designer is free to adjust the weights wi to obtain additional

Figure 15.16: Knot lines for blending function Bi (s, t).

shape control, as in rational B-splines. As we shall see in Section 15.7.2, weights also play a role in
the local refinement algorithm.
The T-spline equation is very similar to the equation for a tensor-product rational B-spline
surface. The difference between the T-spline equation and a B-spline equation is in how the knot
vectors si and ti are determined for each blending function Bi (s, t). Knot vectors si (15.10) and ti
(15.11) are inferred from the T-mesh neighborhood of Pi . Since we will refer to the rule whereby
the knot vectors are inferred, we formally state it as
Rule 1. Knot vectors si (15.10) and ti (15.11) for the blending function of Pi are determined
as follows. (si2 , ti2 ) are the knot coordinates of Pi . Consider a ray in parameter space R(α) =
(si2 + α, ti2 ). Then si3 and si4 are the s coordinates of the first two s-edges intersected by the ray
(not including the initial (si2 , ti2 )). By s-edge, we mean a vertical line segment of constant s. The
other knots in si and ti are found in like manner.
We illustrate Rule 1 by a few examples. The knot vectors for P1 in Figure 15.15 are s1 =
[s0 , s1 , s2 , s3 , s4 ] and t1 = [t1 , t2 , t2 + e6 , t4 , t5 ]. For P2 , s2 = [s3 , s4 , s5 , s6 , s7 ] and t2 = [t0 , t1 , t2 , t2 +
e6 , t4 ]. For P3 , s3 = [s3 , s4 , s5 , s7 , s8 ] and t3 = [t1 , t2 , t2 + e6 , t4 , t5 ]. Once these knot vectors are
determined for each blending function, the T-spline is defined using (15.7) and (15.9).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
T-Splines 169

Numerical Example
Figure 15.17.a shows a T-mesh in knot interval form. While it is possible to work entirely in knot
interval form, our discussion is simplified if we convert to knot vector form. We do this by assigning
the lower-left corner of the domain to have parameter coordinates (s, t) = (0, 0). Then, the knot
lines are determined from the knot intervals, as shown in Figure 15.17.b.

t
P24 P25 6 P26 P27 P24 P25 P26 P27
7
1
P18 P19 P20 P21 3 P22 P23 P18 P19 P20 P21 P22 P23
6
1 P P14 P15 P16 P17 P13 P14 P15 P16 P17
13 2 5

2 (3,4)
5
P10 P11 P12 P10 P11 P12
3

P4 P5 P6 3 P7 2 P8 P9 P4 P5 P6 P7 P8 P9
1
1
1
P0 P1 6 P2 P3 P0 P1 P2 P3 s
0
1 1
0 1 2 4 5 7 8

(a) Model of a hand comprised of B-spline surfaces. (b) NURBS surfaces.

Figure 15.17: Example T-Mesh.

From (15.7), the equation of the T-Spline shown in Figure 15.17.b is


P27
i=0 wi Pi Bi (s, t)
P(s, t) = P n , (15.12)
i=1 wi Bi (s, t)

We now examine the equation P(3, 4) for the T-Spline shown in Figure 15.17.b.
Recall from (15.9) that

Bi (3, 4) = N [si0 , si1 , si2 , si3 , si4 ](3)N [ti0 , ti1 , ti2 , ti3 , ti4 ](4) (15.13)

For example, we have

B10 (3, 4) = N [0, 1, 2, 5, 7](3)N [0, 1, 3, 5, 6](4), B15 (3, 4) = N [1, 2, 4, 5, 7](3)N [1, 3, 5, 6, 7](4),

B0 (3, 4) = N [s0 , s1 , 0, 1, 7](3)N [t0 , t1 , 0, 1, 6](4), B27 (3, 4) = N [1, 7, 8, s2 , s3 ](3)N [1, 6, 7, t2 , t3 ](4).
We now show how to compute B10 (3, 4). The basis function N [0, 1, 2, 4, 5](s) can be written
as an explicit B-Spline curve with seven control points whose polar labels (with y-coordinates)
are f (s0 , s1 , 0) = 0, f (s1 , 0, 1) = 0, f (0, 1, 2) = 0, f (1, 2, 4) = 1, f (2, 4, 5) = 0, f (4, 5, s2 ) = 0,
f (5, s2 , s3 ) = 0. The knots s0 , s1 , s2 , s3 are any real numbers that satisfy s0 ≤ s1 ≤ 0 and
5 ≤ s2 ≤ s3 . The value of N [0, 1, 2, 4, 5](3) is the y-coordinate of the point whose polar label is
f (3, 3, 3). We can compute this as follows:
f (0, 1, 2) + 3f (1, 2, 4) 3 2f (1, 2, 4) + 2f (2, 4, 5) 2
f (1, 2, 3) = = ; f (2, 3, 4) = =
4 4 4 4

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
170 T-Splines

(s2 − 3)f (2, 4, 5) + f (4, 5, s2 ) f (1, 2, 3) + 2f (2, 3, 4) 7


f (3, 4, 5) = = 0; f (2, 3, 3) = =
s2 − 2 3 12
2f (2, 3, 4) + f (3, 4, 5) 1 f (2, 3, 3) + f (3, 3, 4) 11
f (3, 3, 4) = = ; f (3, 3, 3) = = = N [0, 1, 2, 4, 5](3).
3 3 2 24
Likewise, we can compute N [0, 1, 3, 5, 6](4) = 60 23
. Thus, B10 (3, 4) = 1440
253
.
There are several blending functions that are zero at s = 3, t = 4. For example,
B4 (3, 4) = N [s0 , s1 , 0, 1, 2](3)N [t1 , 0, 1, 3, 5](4) = 0 ∗ N [t1 , 0, 1, 3, 5](4) = 0.
Likewise,
B2 (3, 4) = B9 (3, 4) = B17 (3, 4) = B18 (3, 4) = B23 (3, 4) = B25 (3, 4) = B26 (3, 4) = 0.

15.7.2 T-spline Local Refinement


The next three sections discuss an algorithm for local refinement of T-splines. Blending function
refinement plays an important role in this algorithm, and is reviewed in Section 15.7.3. The notion
of T-spline spaces is introduced in Section 15.7.4. This concept is used in the local refinement
algorithm in Section 15.7.5.

15.7.3 Blending Function Refinement


If s = [s0 , s1 , s2 , s3 , s4 ] is a knot vector and s̃ is a knot vector with m knots with s a subsequence
of s̃, then N [s0 , s1 , s2 , s3 , s4 ](s) can be written as a linear combination of the m − 4 B-spline basis
functions defined over the substrings of length 5 in s̃.
We now present all basis function refinement equations for the case m = 6. Equations for m > 6
can be found by repeated application of these equations.
If s = [s0 , s1 , s2 , s3 , s4 ], N (s) = N [s0 , s1 , s2 , s3 , s4 ](s), and s̃ = [s0 , k, s1 , s2 , s3 , s4 ] then
N (s) = c0 N [s0 , k, s1 , s2 , s3 ](s) + d0 N [k, s1 , s2 , s3 , s4 ](s) (15.14)
where c0 = k−s0
s3 −s0 and d0 = 1. If s̃ = [s0 , s1 , k, s2 , s3 , s4 ],
N (s) = c1 N [s0 , s1 , k, s2 , s3 ](s) + d1 N [s1 , k, s2 , s3 , s4 ](s) (15.15)
where c1 = k−s0
s3 −s0 and d1 = s4 −s1 .
s4 −k
If s̃ = [s0 , s1 , s2 , k, s3 , s4 ],
N (s) = c2 N [s0 , s1 , s2 , k, s3 ](s) + d2 N [s1 , s2 , k, s3 , s4 ](s) (15.16)
where c2 = k−s0
s3 −s0 and d2 = s4 −s1 .
s4 −k
If s̃ = [s0 , s1 , s2 , s3 , k, s4 ],
N (s) = c3 N [s0 , s1 , s2 , s3 , k](s) + d3 N [s1 , s2 , s3 , k, s4 ](s) (15.17)
where c3 = 1 and d3 = s4 −s1 .
If k ≤ s0 or k ≥ s4 , N (s) does not change.
s4 −k

A T-spline function B(s, t) can undergo knot insertion in either s or t, thereby splitting it into two
scaled blending functions that sum to the initial one. Further insertion into these resultant scaled
blending functions yields a set of scaled blending functions that sum to the original. For example,
Figure 15.18.a shows the knot vectors for a T-spline blending function B1 , and Figure 15.18.b shows
a refinement of the knot vectors in Figure 15.18.a. By appropriate application of (15.14)—(15.17),
we can obtain
B1 (s, t) = c11 B̃1 (s, t) + c21 B̃2 (s, t) + c31 B̃3 (s, t) + c41 B̃4 (s, t). (15.18)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
T-Splines 171

Figure 15.18: Sample Refinement of B1 (s, t).

15.7.4 T-spline Spaces


We define a T-spline space to be the set of all T-splines that have the same T-mesh topology, knot
intervals, and knot coordinate system. Thus, a T-spline space can be represented by the diagram of
a pre-image of a T-mesh such as in Figure 15.14. Since all T-splines in a given T-spline space have
the same pre-image, it is proper to speak of the pre-image of a T-spline space. A T-spline space S1
is said to be a subspace of S2 (denoted S1 ⊂ S2 ) if local refinement of a T-spline in S1 will produce
a T-spline in S2 (discussed in Section 15.7.5). If T1 is a T-spline, then T1 ∈ S1 means that T1 has a
control grid whose topology and knot intervals are specified by S1 .
Figure 15.19 illustrates a nested sequence of T-spline spaces, that is, S1 ⊂ S2 ⊂ S3 ⊂ · · · ⊂ Sn .

Figure 15.19: Nested sequence of T-spline spaces.

Given a T-spline P(s, t) ∈ S1 , denote by P the column vector of control points for P(s, t), and

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
172 T-Splines

given a second T-spline P̃(s, t) ∈ S2 , such that P(s, t) ≡ P̃(s, t). Denote by P̃ the column vector of
control points for P̃(s, t). There exists a linear transformation that maps P into P̃. We can denote
the linear transformation
M1,2 P = P̃. (15.19)
The matrix M1,2 is found as follows.
P(s, t) is given by (15.7), and

X
P̃(s, t) = P̃j B̃j (s, t) (15.20)
j=1

Since S1 ⊂ S2 , each Bi (s, t) can be written as a linear combination of the B̃j (s, t):

X
Bi (s, t) = cji B̃j (s, t). (15.21)
j=1

We require that
P(s, t) ≡ P̃(s, t). (15.22)
This is satisfied if
n
X
P̃j = cji Pi . (15.23)
i=1

Thus, the element at row j and column i of M1,2 in (15.19) is cji . In this manner, it is possible
to find transformation matrices Mi,j that maps any T-spline in Si to an equivalent T-spline in Sj ,
assuming Si ⊂ Sj .
The definition of a T-spline subspace Si ⊂ Sj means more than simply that the preimage of Sj
has all of the control points that the preimage of Si has.

15.7.5 Local Refinement Algorithm


T-spline local refinement means to insert one or more control points into a T-mesh without changing
the shape of the T-spline surface. This procedure can also be called local knot insertion, since the
addition of control points to a T-mesh must be accompanied by knots inserted into neighboring
blending functions.
The refinement algorithm we now present has two phases: the topology phase, and the geometry
phase. The topology phase identifies which (if any) control points must be inserted in addition
to the ones requested. Once all required new control points are identified, the Cartesian coordi-
nates and weights for the refined T-mesh are computed using the linear transformation presented in
Section 15.7.4. We now explain the topology phase of the algorithm.
An important key to understanding this discussion is to keep in mind how in a T-spline, the
blending functions and T-mesh are tightly coupled: To every control point there corresponds a
blending function, and each blending function’s knot vectors are defined by Rule 1. In our discussion,
we temporarily decouple the blending functions from the T-mesh. This means that during the flow
of the algorithm, we temporarily permit the existence of blending functions that violate Rule 1, and
control points to which no blending functions are attached.
Our discussion distinguishes three possible violations that can occur during the course of the
refinement algorithm:

• Violation 1 A blending function is missing a knot dictated by Rule 1 for the current T-mesh.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
T-Splines 173

• Violation 2 A blending function has a knot that is not dictated by Rule 1 for the current
T-mesh.

• Violation 3 A control point has no blending function associated with it.

If no violations exist, the T-spline is valid. If violations do exist, the algorithm resolves them one
by one until no further violations exist. Then a valid superspace has been found.
The topology phase of our local refinement algorithm consists of these steps:

1. Insert all desired control points into the T-mesh.

2. If any blending function is guilty of Violation 1, perform the necessary knot insertions into
that blending function.

3. If any blending function is guilty of Violation 2, add an appropriate control point into the
T-mesh.

4. Repeat Steps 2 and 3 until there are no more violations.

Resolving all cases of Violation 1 and 2 will automatically resolve all cases of Violation 3.
We illustrate the algorithm with an example. Figure 15.20.a shows an initial T-mesh into which
we wish to insert one control point, P2 . Because the T-mesh in Figure 15.20.a is valid, there
are no violations. But if we simply insert P2 into the T-mesh (Figure 15.20.b) without chang-
ing any of the blending functions, we introduce several violations. Since P2 has knot coordinates
(s3 , t2 ), four blending functions become guilty of Violation 1: those centered at (s1 , t2 ), (s2 , t2 ),
(s4 , t2 ), and (s5 , t2 ). To resolve these violations, we must insert a knot at s3 into each of those
blending functions, as discussed in Section 15.7.3. The blending function centered at (s2 , t2 ) is
N [s0 , s1 , s2 , s4 , s5 ](s)N [t0 , t1 , t2 , t3 , t4 ](t). Inserting a knot s = s3 into the s knot vector of this blend-
ing function splits it into two scaled blending functions: c2 N [s0 , s1 , s2 , s3 , s4 ](s)N [t0 , t1 , t2 , t3 , t4 ](t)
(Figure 15.20.c) and d2 N [s1 , s2 , s3 , s4 , s5 ](s)N [t0 , t1 , t2 , t3 , t4 ](t) (Figure 15.20.d) as given in (15.16).
The blending function c2 N [s0 , s1 , s2 , s3 , s4 ](s)N [t0 , t1 , t2 , t3 , t4 ](t) in Figure 15.20.c satisfies Rule
1. Likewise, the refinements of the blending functions centered at (s1 , t2 ), (s4 , t2 ), and (s5 , t2 ) all sat-
isfy Rule 1. However, the t knot vector of blending function d2 N [s1 , s2 , s3 , s4 , s5 ](s)N [t0 , t1 , t2 , t3 , t4 ](t)
shown in Figure 15.20.d is guilty of Violation 2 because the blending function’s t knot vector is
[t0 , t1 , t2 , t3 , t4 ], but Rule 1 does not call for a knot at t3 . This problem cannot be remedied by
refining this blending function; we must add an additional control point into the T-mesh.
The needed control point is P3 in Figure 15.20.e. Inserting that control point fixes the case
of Violation 2, but it creates a new case of Violation 1. As shown in Figure 15.20.f, the blending
function centered at (s2 , t3 ) has an s knot vector that does not include s3 as required by Rule 1.
Inserting s3 into that knot vector fixes the problem, and there are no further violations of Rule 1.
This algorithm is always guaranteed to terminate, because the only blending function refinements
and control point insertions must involve knot values that initially exist in the T-mesh, or that were
added in Step 1. In the worst case, the algorithm would extend all partial rows of control points
to cross the entire surface. In practice, the algorithm typically requires few if any additional new
control points beyond the ones the user wants to insert.

15.7.6 Converting a T-spline into a B-spline surface


This refinement algorithm makes it easy to convert a T-spline ∈ S1 into an equivalent B-spline
surface ∈ Sn : simply compute the transformation matrix M1,n as discussed in Section 15.7.4.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
174 T-Splines

Figure 15.20: Local refinement example.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Efficient Computation of Points and Tangents on a Bézier surface patch. 175

Pn Pn
A standard T-spline is one for which, if all weights wi = 1, then i=1 wi Bi (s, t) ≡ i=1 Bi (s, t) ≡
1. This means that the denominator in (15.7) is identically equal to one; hence, the blending functions
provide a partition of unity and the T-spline is polynomial. Thus, an algebraic statement of necessary
and sufficient conditions for a T-spline to be standard is each row of M1,n sums to 1.
The
Pn insertion algorithm can produce a surprising result: a T-spline for which not all wi = 1 but
yet i=1 wi Bi (s, t) ≡ 1. This is called a semi-standard T-spline. Figure 15.21 shows two simple
examples of semi-standard T-splines. The integers (1 and 2) next to some edges are knot intervals.
To verify that these T-splines are semi-standard, convert them into B-spline surfaces; the control

Figure 15.21: Semi-standard T-splines.

point weights will all be one.


The notion of T-spline spaces in Section 15.7.4 enables a more precise definition of semi-standard
and non-standard T-splines.
Pn A semi-standard T-spline space S is one for which there exists some
elements of S for which i=1 wi Bi (s, t) ≡ P1, and not all wi = 1. A non-standard T-spline space is
n
one for which no elements exist for which i=1 wi Bi (s, t) ≡ 1. These definitions are more precise
because they allow for the notion of a rational T-spline (weights not all = 1) that is either standard,
semi-standard, or non-standard. The distinction is made based on which type of T-spline space it
belongs to.

15.8 Efficient Computation of Points and Tangents on a Bézier


surface patch.
This section presents an algorithm for computing points and tangents on a tensor-product rational
Bézier surface patch that has O(n2 ) time complexity.
Define a rational Bézier curve in R3 with the notation

p(t) = Π (P(t)) (15.24)

with
n
X
P(t) = (Px (t), Py (t), Pz (t), Pw (t)) = Pi Bin (t) (15.25)
i=0

where Pi = wi (xi , yi , zi , 1) and the projection operator Π is defined Π(x, y, z, w) = (x/w, y/w, z/w).
In this section, we will use upper case bold-face variables to denote four-tuples (homogeneous points)
and lower case bold-face for triples (points in R3 ).
The point and tangent of this curve can be found using the familiar construction

P(t) = (1 − t)Q(t) + tR(t) (15.26)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
176 Efficient Computation of Points and Tangents on a Bézier surface patch.

with
n−1
X
Q(t) = Pi Bin−1 (t) (15.27)
i=0

and
n
X
R(t) = Pi Bi−1
n−1
(t) (15.28)
i=1

where line q(t)—r(t) ≡ Π (Q(t))—Π (R(t)) is tangent to the curve, as seen in Figure 16.1. As a
sidenote, the correct magnitude of the derivative of p(t) is given by

dp(t) Rw (t)Qw (t)


=n [r(t) − q(t)] (15.29)
dt ((1 − t)Qw (t) + tRw (t))2

p2 pn-2

p1 q(t)
p(t) r(t)

pn-1

p0 pn

Figure 15.22: Curve example

The values Q(t) and R(t) can be found using the modified Horner’s algorithm for Bernstein
polynomials, involving a pseudo–basis conversion
n−1
Q(t) X
= Q̂(u) = Q̂i ui (15.30)
(1 − t) n−1
i=0

where u = 1−t
t
and Q̂i = n−1 Pi , i = 0, 1, . . . , n − 1. Assuming the curve is to be evaluated several

i
times, we can ignore the expense of precomputing the Q̂i , and the nested multiplication

Q̂(u) = [· · · [[Q̂n−1 u + Q̂n−2 ]u + Q̂n−3 ]u + . . . Q̂1 ]u + Q̂0 (15.31)

can be performed with n − 1 multiplies and adds for each of the four x, y, z, w coordinates. It is not
necessary to post-multiply by (1 − t)n−1 , since
   
Π (Q(t)) = Π (1 − t)n−1 Q̂(u) = Π Q̂(t) . (15.32)

Therefore, the point P(t) and its tangent direction can be computed with roughly 2n multiplies and
adds for each of the four x, y, z, w coordinates.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Efficient Computation of Points and Tangents on a Bézier surface patch. 177

This method has problems near t = 1, so it is best for .5 ≤ t ≤ 1 to use the form
n−1
Q(t) X
= Q̂n−i−1 ui (15.33)
tn−1 i=0

t .
with u = 1−t
A tensor product rational Bézier surface patch is defined
p(s, t) = Π (P(s, t)) (15.34)
where
m X
X n
P(s, t) = Pij Bim (s)Bjn (t). (15.35)
i=0 j=0

We can represent the surface p(s, t) using the following construction:


P(s, t) = (1 − s)(1 − t)P00 (s, t) + s(1 − t)P10 (s, t) + (1 − s)tP01 (s, t) + stP11 (s, t) (15.36)
where
m−1
X n−1
X
P00 (s, t) = Pij Bim−1 (s)Bjn−1 (t), (15.37)
i=0 j=0
m n−1
X X
P10 (s, t) = Pij Bi−1
m−1
(s)Bjn−1 (t), (15.38)
i=1 j=0
m−1
XX n
P01 (s, t) = Pij Bim−1 (s)Bj−1
n−1
(t), (15.39)
i=0 j=1
m X
X n
P11 (s, t) = Pij Bi−1
m−1
(s)Bj−1
n−1
(t). (15.40)
i=1 j=1

The tangent vector ps (s, t) is parallel with the line


Π (1 − t)P00 (s, t) + tP01 (s, t) —Π (1 − t)P10 (s, t) + tP11 (s, t) (15.41)
 

and the tangent vector pt (s, t) is parallel with


Π (1 − s)P00 (s, t) + sP10 (s, t) —Π (1 − s)P01 (s, t) + sP11 (s, t) . (15.42)
 

The Horner algorithm for a tensor product surface emerges by defining


m+k−1
X n+l−1
Pkl (s, t) X
= P̂ kl
(u, v) = P̂kl
ij u v ;
i j
k, l = 0, 1 (15.43)
(1 − s)m−1 (1 − t)n−1
i=k j=l

where u = 1−ss
, v = 1−t
t
, and P̂kl
ij = i−k
m−1 n−1
j−l Pij . The n rows of these four bivariate polynomials
 

can each be evaluated using m − 1 multiplies and adds per x, y, z, w component, and the final
evaluation in t costs n − 1 multiplies and adds per x, y, z, w component.
Thus, if m = n, the four surfaces P00 (s, t), P01 (s, t), P10 (s, t), and P11 (s, t) can each be evaluated
using n2 − 1 multiplies and n2 − 1 adds for each of the four x, y, z, w components, a total of 16n2 − 16
multiplies and 16n2 − 16 adds.
If one wishes to compute a grid of points on this surface which are evenly spaced in parameter
space, the four surfaces P00 (s, t), P01 (s, t), P10 (s, t), and P11 (s, t) can each be evaluated even more
quickly using forward differencing.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
178 Curvature at the Corner of a Bézier Surface Patch

15.9 Curvature at the Corner of a Bézier Surface Patch


We have seen in Section ?? how the curvature of a degree n rational Bézier curve with control points
P0 , P1 , · · · , Pn and weights ω0 , ω1 , · · · , ωn , at the starting point P0 is given by
n − 1 ω0 ω2 h
k= (15.44)
n ω12 a2
where a is the length of edge P0 P1 , and h is the distance of P2 to the tangent spanned by P0
and P1 (see Figure 15.23). This formula is more intuitive than the one given by classic differential
geometry, and is also easier to compute, especially in the rational case.

Pn

P2
h

P0 a P1

Figure 15.23: Curvature of a Bézier curve.

This section derives similar formulae for Gaussian and mean curvatures of rational Bézier patches.
The derived formulae are expressed in terms of simple geometric quantities of the control mesh.

15.9.1 Curvatures of tensor-product rational Bézier surfaces


Suppose a degree n × m rational Bézier patch is defined by
n P
m
ωij Pij Bin (u)Bjm (v)
P
i=0 j=0
r(u, v) = n Pm (15.45)
ωij Bin (u)Bjm (v)
P
i=0 j=0

where Bik (t) = i (1 − t)k−i ti are Bernstein polynomials; Pij are the control points, forming a
k


control mesh; and wij are the weights. When all the weights are the same, the patch reduces to a
polynomial surface. We derive the curvature formulae at the bottom-left corner (u, v) = (0, 0).
By differential geometry,Gaussian curvature Kg and mean curvature Km can be computed by
the following formulae
LN − M 2
Kg = , (15.46)
EG − F 2
1 LG − 2M F + N E
Km = (15.47)
2 EG − F 2
where E, F, G are the coefficients of the first fundamental form, i.e.,
E = ru · ru , F = ru · rv , G = rv · rv , (15.48)
L, M, N are the coefficients of the second fundamental form, i.e.,
L = ruu · n, M = ruv · n, N = rvv · n, (15.49)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curvature at the Corner of a Bézier Surface Patch 179

P02
h02
d
P01
P11
b f
h11
S e
P00 !
a P20
c h20
P10

Figure 15.24: Part of a rectangular mesh.

and n = ru × rv /kru × rv k is the unit normal vector.


For the rational Bézier patch (15.45), we introduce some notations as follows (see Figure 15.24):

a = P10 − P00 , b = P01 − P00 , c = P20 − P10 ,


(15.50)
d = P02 − P01 , e = P11 − P10 , f = P11 − P01 .

Furthermore, let S denote the area of the triangle P00 P10 P01 , θ be the angle between vectors P00 P10
and P00 P01 , and hij be the signed distance from Pij to the plane spanned by P00 , P10 and P01 .
If Pij lies on the side of the plane P00 P10 P01 with the direction P00 P10 × P00 P01 , hij is positive.
Otherwise, hij is negative.
It is easy to check that at (u, v) = (0, 0), we have
ω10 ω01
ru (0, 0) = n a, rv (0, 0) = m b. (15.51)
ω00 ω00
For notational simplicity, in the following where there is no ambiguity, we omit the parameter values
(0, 0). Thus
 2    2
ω10 ω10 ω01 ω01
E = n2 a · a, F = nm 2 a · b, G = m2 b · b. (15.52)
ω00 ω00 ω00

Note that for a rational surface r(u, v) = R(u, v)/ω(u, v), the first partial derivative ru (u, v) =
Ruu − rωuu Ru ωu − rωu2 ωu
(Ru −r ωu )/ω, and the second partial derivative ruu = − −ru . Applying
ω ω2 ω
these to the rational Bézier patch (15.45) and letting (u, v) = (0, 0) lead to
ω20
ruu = n(n − 1) c + (· · · )a
ω00

where (· · · ) denotes a rather complicated expression that we will not need to be concerned with
since subsequent dotting with n will cause it to vanish. Similarly, we can obtain
ω11
ruv = nm f + (· · · )a + (· · · )b,
ω00

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
180 Curvature at the Corner of a Bézier Surface Patch

ω02
rvv = m(m − 1) d + (· · · )b.
ω00

Also note that n = a × b/ka × bk. By the definition (15.49) of L, M and N , we have

ω20 ω11 ω02


L = n(n − 1) h20 , M = nm h11 , N = m(m − 1) h02 . (15.53)
ω00 ω00 ω00

Now substituting (15.52) and (15.53) into (15.46) and (15.47), and doing some simplifications,
we get the formulae for Gaussian and mean curvatures
2 n−1 m−1 2 2
− ω11

ω00 m ω20 ω02 h20 h02 h11
Kg = n
, (15.54)
ω10 ω01 ka × bk2

n ω01 b ω20 h20 − 2ω10 ω01 (a · b)ω11 h11 + m ω10 a ω02 h02
n−1 2 2 m−1 2 2
ω00
Km = . (15.55)
2 ω2
ω10 01 2ka × bk2

If we further introduce notations


ω10 ω01 1 ω10 ω01 ω10 ω01
ã = kak, b̃ = kbk, S̃ = k a× bk = S ,
ω00 ω00 2 ω00 ω00 2
ω00
ω11 n − 1 ω20 m − 1 ω02
h̃11 = h11 , h̃20 = h20 , h̃02 = h02 ,
ω00 n ω00 m ω00

then the formulae can be symbolically simplified to


 
Kg = h̃20 h̃02 − h̃211 /4S̃ 2 , (15.56)

 
Km = h̃20 b̃2 − 2h̃11 ã b̃ cos θ + h̃02 ã2 /8S̃ 2 . (15.57)

Remark 1. Obviously, formulae (15.54) and (15.55) or (15.56) and (15.57) just contain some
simple geometric quantities, like (scaled) length or area, related to the control mesh of the rational
Bézier patch. Compared to the formulae (15.46) and (15.47), they are more intuitive and also simpler
to compute.
Remark 2. Though the equations derived above are valid at the bottom-left corner, by sym-
metry similar formulae are easily written out at the other three corners of the rational Bézier patch.
Moreover, at any point of the surface other than the four corners, the formulae can also be used to
calculate curvatures with help of subdividing the surface there.
Remark 3. According to differential geometry, from Gaussian and mean curvatures, we can
compute the principal curvatures
q
k1,2 = Km ± 2 −K .
Km g

Meanwhile, the principal directions of curvatures can be determined by

du M − k1,2 F N − k1,2 G
=− =− .
dv L − k1,2 E M − k1,2 F

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curvature at the Corner of a Bézier Surface Patch 181

P02(n-2)
h02
P01(n-1) P11(n-2)
b h11
! S
P00n P20(n-2)
a
P10(n-1) h20

Figure 15.25: Part of a triangular mesh.

15.9.2 Curvatures of triangular rational Bézier surfaces


A triangular rational Bézier patch of degree n is defined by
ωijk Pijk Bijk
n
(u, v)
P
i+j+k=n
r(u, v) = P n (u, v) (15.58)
ωijk Bijk
i+j+k+n

n! i j
where Bijk
n
(u, v) = u v (1 − u − v)k are Bernstein polynomials; Pijk are the control points,
i!j!k!
forming a triangular control mesh (see Figure 15.25); and ωijk are the weights.
As in the tensor-product case, we only consider the curvatures at corner (u, v) = (0, 0). Although
we can follow the straightforward approach of Section 15.9.1, i.e., computing the partial derivatives
of the triangular Bézier patch, here we take another approach. Since the triangular patch r(u, v) can
be considered as a degree n × n tensor-product rational Bézier patch, we can utilize the established
formulae (15.54) and (15.55).
Let a = P10(n−1) −P00n , b = P01(n−1) −P00n , S denote the area of the triangle P00n P10(n−1) P01(n−1) ,
θ be the angle between vectors P00n P10(n−1) and P00n P01(n−1) , and hij be the signed distance from
Pij(n−i−j) to the plane spanned by P00n , P10(n−1) and P01(n−1) . Suppose the tensor-product rep-
resentation of the patch (15.58) is
n P
n
ω̄ij P̄ij Bin (u)Bjn (v)
P
i=0 j=0
r(u, v) = n P n .
ω̄ij Bin (u)Bjn (v)
P
i=0 j=0

It is easy to show that P̄ij = Pij(n−i−j) and ω̄ij = ωij(n−i−j) for (i, j) = (0, 0), (1, 0), and (0, 1). Thus
the geometric quantities, like a, b, hij , and etc., are the same as their counterparts in the tensor-
product representation except for h11 . Therefore we only need to check P̄11 and ω̄11 . Considering
the mixed derivative of the denominators of the above two representations at (u, v) = (0, 0), we get
n−1 ω10(n−1) + ω01(n−1) − ω00n
ω̄11 = ω11(n−2) +
n n

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
182 Curvature at the Corner of a Bézier Surface Patch

Similarly, by considering the numerators, we have

n − 1 ω11(n−2) ω10(n−1) P10(n−1) + ω01(n−1) P01(n−1) − ω00n P00n


P̄11 = P11(n−2) +
n ω̄11 nω̄11
n−1
If we denote the signed distance of P̄11 to the plane P̄00 P̄10 P̄01 by h̄11 , then ω̄11 h̄11 =
ω11(n−2) h11 .
n
We substitute all the above relations into (15.54) and (15.55), and the formulae of Gaussian and
mean curvatures for the triangular rational Bézier patch (15.58) turn out to be
2
h211
2  2
n−1 ω20(n−2) ω02(n−2) h20 h02 − ω11(n−2)

ω00n
Kg = , (15.59)
n ω10(n−1) ω01(n−1) ka × bk2

n−1 ω00n
Km = 2 2 ·
n ω10(n−1) ω01(n−1)
(15.60)
2
ω01(n−1) b2 ω20(n−2) h20 − 2ω10(n−1) ω01(n−1) (a · b)ω11(n−2) h11 + ω10(n−1)
2
a2 ω02(n−2) h02
,
2ka × bk2
or just (15.56) and (15.57) if the following notations are adopted

ω10(n−1) ω01(n−1)
ã = kak, b̃ = kbk,
ω00n ω00n
ω10(n−1) ω01(n−1) n − 1 ωij(n−i−j)
S̃ = S 2 , h̃ij = hij .
ω00n n ω00n

15.9.3 Curvature of an Implicit Surface


We complete our discussion of curvature by providing the formulae for the Gaussian and mean
curvatures at a point on an implicit surface f (x, y, z) = 0:

fzz (fy2 + fx2 ) − 2fx fy fxy + fxx (fy2 + fz2 ) − 2fy fz fyz + fyy (fx2 + fz2 ) − 2fz fx fxz
Km = (15.61)
2λ3
1
Kg = [−2fx fy fxy fzz + fyy fxx fz2 − 2fy fz fyz fxx + fzz fyy fx2 − 2fz fx fxz fyy + fxx fzz fy2
λ4
−fx2 fyz
2
− fy2 fxz
2
− fz2 fxy
2
+ 2fx fy fxz fyz + 2fy fz fxy fxz + 2fx fz fxy fyz ] (15.62)
where q
λ= fx2 + fy2 + fz2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 16

Computing Points and Tangents on


Bézier Surface Patches

This chapter presents an algorithm for computing points and tangents on a tensor-product rational
Bézier surface patch that has O(n2 ) time complexity.
A rational Béziercurve in R3 is defined

p(t) = Π (P(t)) (16.1)

with
n
X
P(t) = (Px (t), Py (t), Pz (t), Pw (t)) = Pi Bin (t) (16.2)
i=0

where Pi = wi (xi , yi , zi , 1) and the projection operator Π is defined Π(x, y, z, w) = (x/w, y/w, z/w).
We will use upper case bold-face variables to denote four-tuples (homogeneous points) and lower
case bold-face for triples (points in R3 ).
The point and tangent of this curve can be found using the familiar construction

P(t) = (1 − t)Q(t) + tR(t) (16.3)

with
n−1
X
Q(t) = Pi Bin−1 (t) (16.4)
i=0

and
n
X
R(t) = Pi Bi−1
n−1
(t) (16.5)
i=1

where line q(t)—r(t) ≡ Π (Q(t))—Π (R(t)) is tangent to the curve, as seen in Figure 16.1. As a
sidenote, the correct magnitude of the derivative of p(t) is given by

dp(t) Rw (t)Qw (t)


=n [r(t) − q(t)] (16.6)
dt ((1 − t)Qw (t) + tRw (t))2

183
184

p2 pn-2

p1 q(t)
p(t) r(t)

pn-1

p0 pn

Figure 16.1: Curve example

The values Q(t) and R(t) can be found using the modified Horner’s algorithm for Bernstein
polynomials, involving a pseudo–basis conversion
n−1
Q(t) X
= Q̂(u) = Q̂i ui (16.7)
(1 − t) n−1
i=0

where u = 1−t
t
and Q̂i = n−1 Pi , i = 0, 1, . . . , n − 1. Assuming the curve is to be evaluated several

i
times, we can ignore the expense of precomputing the Q̂i , and the nested multiplication

Q̂(u) = [· · · [[Q̂n−1 u + Q̂n−2 ]u + Q̂n−3 ]u + . . . Q̂1 ]u + Q̂0 (16.8)

can be performed with n − 1 multiplies and adds for each of the four x, y, z, w coordinates. It is not
necessary to post-multiply by (1 − t)n−1 , since
   
Π (Q(t)) = Π (1 − t)n−1 Q̂(u) = Π Q̂(t) . (16.9)

Therefore, the point P(t) and its tangent direction can be computed with roughly 2n multiplies and
adds for each of the four x, y, z, w coordinates.
This method has problems near t = 1, so it is best for .5 ≤ t ≤ 1 to use the form
n−1
Q(t) X
= Q̂n−i−1 ui (16.10)
tn−1 i=0

with u = 1−t
t .
A tensor product rational Béziersurface patch is defined

p(s, t) = Π (P(s, t)) (16.11)

where
m X
X n
P(s, t) = Pij Bim (s)Bjn (t). (16.12)
i=0 j=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
185

We can represent the surface p(s, t) using the following construction:

P(s, t) = (1 − s)(1 − t)P00 (s, t) + s(1 − t)P10 (s, t) + (1 − s)tP01 (s, t) + stP11 (s, t) (16.13)

where
m−1
X n−1
X
P00 (s, t) = Pij Bim−1 (s)Bjn−1 (t), (16.14)
i=0 j=0

m n−1
X X
P10 (s, t) = Pij Bi−1
m−1
(s)Bjn−1 (t), (16.15)
i=1 j=0

m−1
XX n
P01 (s, t) = Pij Bim−1 (s)Bj−1
n−1
(t), (16.16)
i=0 j=1
m X
X n
P (s, t) =
11
Pij Bi−1
m−1
(s)Bj−1
n−1
(t). (16.17)
i=1 j=1

The tangent vector ps (s, t) is parallel with the line

Π (1 − t)P00 (s, t) + tP01 (s, t) —Π (1 − t)P10 (s, t) + tP11 (s, t) (16.18)


 

and the tangent vector pt (s, t) is parallel with

Π (1 − s)P00 (s, t) + sP10 (s, t) —Π (1 − s)P01 (s, t) + sP11 (s, t) . (16.19)


 

The Horner algorithm for a tensor product surface emerges by defining


m+k−1
X n+l−1
Pkl (s, t) X
= P̂ kl
(u, v) = P̂kl
ij u v ;
i j
k, l = 0, 1 (16.20)
(1 − s) m−1 (1 − t)n−1
i=k j=l

where u = 1−ss
, v = 1−t
t
, and P̂kl
ij = i−k
m−1 n−1
j−l Pij . The n rows of these four bivariate polynomials
 

can each be evaluated using m − 1 multiplies and adds per x, y, z, w component, and the final
evaluation in t costs n − 1 multiplies and adds per x, y, z, w component.
Thus, if m = n, the four surfaces P00 (s, t), P01 (s, t), P10 (s, t), and P11 (s, t) can each be evaluated
using n2 − 1 multiplies and n2 − 1 adds for each of the four x, y, z, w components, a total of 16n2 − 16
multiplies and 16n2 − 16 adds.
If one wishes to compute a grid of points on this surface which are evenly spaced in parameter
space, the four surfaces P00 (s, t), P01 (s, t), P10 (s, t), and P11 (s, t) can each be evaluated even more
quickly using forward differencing.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
186

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 17

Algebraic Geometry for CAGD

Initially, the field of computer aided geometric design and graphics drew most heavily from differen-
tial geometry, approximation theory, and vector geometry. Since the early 1980’s, some of the tools
of algebraic geometry have been introduced into the CAGD literature. This chapter presents some
of those tools, which can address the following problems:
x(t) y(t)
1. Given a planar curve defined parametrically as x = w(t) , y = w(t) where x(t), y(t), and w(t)
are polynomials, find an implicit equation f (x, y) = 0 which defines the same curve. This
process of parametric to implicit conversion will be referred to as implicitization.
x(t) y(t)
2. Given the (x, y) coordinates of a point which lies on a parametric curve x = w(t) , y = w(t) ,
find the parameter value t which corresponds to that point. This problem will be referred to
as the inversion problem.

3. Compute the points of intersection of two parametric curves using the implicitization and inver-
sion techniques.

Section 1.4 presents some preliminary terminology and theorems. Sections 17.1 through 17.4
discuss the implicitization and inversion of planar curves, and Section 17.5 applies those tools to
computing curve intersections. Section 17.8 discusses some special properties of parametric cubic
curves and Section 17.9 overviews surface implicitization. Section 17.11 discusses Gróbner bases.

17.1 Implicitization
It was noted that there are basically two ways that a planar curve can be defined: parametrically
(x = x(t)/w(t), y = y(t)/w(t)) and implicitly (f (x, y) = 0).
Obviously, the parametric equation of a curve has the advantage of being able to quickly compute
the (x, y) coordinates of several points on the curve for plotting purposes. Also, it is simple to define
a curve segment by restricting the parameter t to a finite range, for example 0 ≤ t ≤ 1. On the other
hand, the implicit equation of a curve enables one to easily determine whether a given point lies on
the curve, or if not, which side of the curve it lies on.
Given these two different equations for curves, it is natural to wonder if it is possible to convert
between representations for a given curve. The answer is that it is always possible to find an
implicit equation of a parametric curve, but a parametric equation can generally be found only

187
188 Brute Force Implicization

for implicit curves of degree two or one. The process of finding the implicit equation of a curve
which is expressed parametrically is referred to as implicitization. In Section 17.4, we will discuss
how this can be accomplished using an important algebraic tool, the resultant, and Section 17.3
discusses resultants. Section 17.2 suggests how someone might tackle the implicitization problem
before learning about resultants. Section 17.5 applies these ideas to the problem of intersecting two
parametric curves.

17.2 Brute Force Implicization


Consider this simple example of parametric-to-implicit conversion: Given a line

x = t + 2 y = 3t + 1,

we can easily find an implicit equation which identically represents this line by solving for t as a
function of x
t = x − 2
and substituting into the equation for y:

y = 3(x − 2) + 1

or 3x − y − 5 = 0. Note that this implicit equation defines precisely the same curve as does the
parametric equation. We can also identify two inversion equations (for finding the parameter value
of a point on the line): t = x − 2 or t = (y − 1)/3.
This approach to implicitization also works for degree two parametric curves. Consider the
parabola
x = t2 + 1 y = t2 + 2t − 2.
Again, we can solve for t as a function of x:

t = ± x − 1

and substitute into the equation for y:


√ √
y = ( x − 1)2 ± 2 x − 1 − 2.

We can isolate the radical and square both sides



(y − (x − 1) + 2)2 = (±2 x − 1)2

to yield
x2 − 2xy + y 2 − 10x + 6y + 13 = 0
which is the desired implicit equation. Again, this implicit equation defines exactly the same curve
as does the parametric equation.
We run into trouble if we try to apply this implicitization technique to curves of degree higher
than two. Note that the critical step is that we must be able to express t as a function of x. For
cubic and quartic equations, this can be done, but the resulting expression is hopelessly complex.
For curves of degree greater than four, it is simply not possible.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Polynomial Resultants 189

We cannot obtain an inversion equation for this parabola the way we did for the straight line.
For example, suppose we want to find the parameter of the point (5, −2) which we know to lie on
the curve. The brute force approach would be to find the values of t which satisfy the equation
x = 5 = t2 + 1
and then to compare them with the values of t which satisfy the equation
y = − 2 = t2 + 2t − 2.
In the first case, we find t = -2 or 2, and in the second case, t = -2 or 0. The value of t which
satisfies both equations is -2, which must therefore be the parameter value of the point (5,-2).
This unsuccessful attempt at implicitization and inversion motivates the following discussion
of resultants, which will provide an elegant, general solution to the implicitization and inversion
problems.

17.3 Polynomial Resultants


17.3.1 Definition of the Resultant of Two Polynomials
Polynomial resultants address the question of whether two polynomials have a common root. Con-
sider the two polynomials
n
X n
X
f (t) = ai ti g(t) = bi ti (17.1)
i=0 i=0

The resultant of f (t) and g(t), written R(f, g), is an expression for which R(f, g) = 0 if and only
iff (t) and g(t) have a common root.
Consider the resultant of two polynomials given in factored form:
f (t) = (t − f1 )(t − f2 ) · · · (t − fm ), g(t) = (t − g1 )(t − g2 ) · · · (t − gn ) (17.2)
where f1 , f2 , . . . fm are the roots of f (t) and g1 , g2 , . . . gn are the roots of g(t). The resultant of
f (t) and g(t) is the unique polynomial expression that will be zero if and only if at least one fi is
the same as at least one gi :
Ym Y n
R(f, g) = (fi − gj )
i=1 j=1

For example, the resultant of f (t) = t − 7t + 12 = (t − 3)(t − 4) and g(t) = t2 − 3t + 2 = (t − 2)(t − 1)


2

is
R(f, g) = (3 − 2)(3 − 1)(4 − 2)(4 − 1) = 12 (17.3)
while the resultant of f (t) = t2 − 7t + 12 = (t − 3)(t − 4) and g(t) = t2 − 5t + 6 = (t − 2)(t − 3) is
R(f, g) = (3 − 2)(3 − 3)(4 − 2)(4 − 3) = 0.
Of course, if f (t) and g(t) are given in factored form, it is a trivial matter to detect if they have any
common roots. However, it takes a fair amount of computation to determine all roots of a polynomial,
and those roots are typically not rational and often complex. Therefore, of much greater value would
an equation for a resultant that does not require the polynomials to be given in factored form, but
can be computed directly from equations (17.1). The good news is that such equations for a resultant
do exist and are relatively easy to compute, without needing to first compute any polynomial roots.
Such an equation for the resultant can be written in closed form. Furthermore, if the polynomial
coefficients are integers, the resultant will also be an integer, even if the roots are complex!

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
190 Polynomial Resultants

17.3.2 Resultant of Two Degree One Polynomials


The simplest resultant is for the case when f (t) and g(t) are degree one:

f (t) = a1 t + a0 ; g(t) = b1 t + b0 .

The root of f (t) and the root of g(t) are easily found:

a0 b0
a1 t + a0 = 0 → t = − ; b1 t + b0 = 0 → t = − ;
a1 b1

Since each polynomial has exactly one root, f (t) and g(t) have a common root if and only if

a0 b0
− = , or a1 b0 − b1 a0 = 0.
a1 b1

The resultant of f (t) and g(t) is thus

R(f, g) = a1 b0 − b1 a0 . (17.4)

We can also derive this resultant using matrix algebra. This will make more sense if we use the
homogeneous form
f (T, U ) = a1 T + a0 U ; g(T, U ) = b1 T + b0 U
where t = T /U The equations f (T, U ) = 0 and g(T, U ) = 0 can be written

0
    
a1 a0 T
= (17.5)
b1 b0 U 0

This is a system of homogeneous linear equations. We know from linear algebra that the necessary
and sufficient condition for this system to have a solution is if the determinant of the matrix is zero,
that is, if
a1 a0
b1 b0 = a1 b0 − b1 a0 = 0

This is the same equation as the resultant that we arrived at earlier.


This resultant can answer for us the question of whether two degree-one polynomials have a
common root.

Example: Do f (t) = 2t + 1 and g(t) = t + 3 have a common root? They have a common root if and
only if their resultant is zero. Since R(f, g) = 2 · 3 − 1 · 1 = 5 6= 0, they do not have a common root.

Example: Do f (t) = t−2 and g(t) = 3t−6 have a common root? Since R(f, g) = 1·(−6)−3·(−2) = 0,
they do have a common root.

17.3.3 Resultants of Degree-Two Polynomials


The degree one resultant is obvious. Higher-degree resultants are not so obvious. Consider the
degree two polynomials

f (t) = a2 t2 + a1 t + a0 , g(t) = b2 t2 + b1 t + b0 .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Polynomial Resultants 191

It does not work so well to solve for the roots of these two polynomials and check for a common
root. The roots of f (t) and g(t) are, respectively,

a21 − 4a2 a0 b21 − 4b2 b0


p p
−a1 ± −b1 ±
t= , t=
2a2 2b2

So, f (t) and g(t) have a common root if and only if

−a1 + a21 − 4a2 a0 −b1 + b21 − 4b2 b0 −a1 + a21 − 4a2 a0 −b1 − b21 − 4b2 b0
p p p p
= , or = , or
2a2 2b2 2a2 2b2

a21 − 4a2 a0 −b1 + b21 − 4b2 b0 −a1 − a21 − 4a2 a0 −b1 − b21 − 4b2 b0
p p p p
−a1 −
= , or =
2a2 2b2 2a2 2b2
But, the resultant we are looking for is a single expression in terms of a0 , a1 , a2 , b0 , b1 , and b2
that will be zero if and only if one or more of the above expressions is true. We could accomplish
that some algebraic manipulation of these equations, but there is an easier way, one that extends to
polynomials of any degree.
For this degree-two case, the idea is to create a pair of degree-one polynomials h1 (t) and h2 (t)
that will have a common root if and only if f (t) and g(t) have a common root. Those polynomials
are:

h1 (t) = a2 g(t) − b2 f (t) = a2 (b2 t2 + b1 t + b0 ) − b2 (a2 t2 + a1 t + a0 )


= (2, 1)t + (2, 0) (17.6)

where the notation (ai bj ) = ai bj − aj bi . We also create

h2 (t) = (a2 t + a1 )g(t) − (b2 t + b1 )f (t)


= (a2 t + a1 )(b2 t2 + b1 t + b0 ) − (b2 t + b1 )(a2 t2 + a1 t + a0 )
= (a2 b0 )t + (a1 b0 ) (17.7)

It is easy to verify that h1 (t) and h2 (t) will each vanish for any value of t that is a common root
of f (t) and g(t). Therefore, any common root of f (t) and g(t) is also a common root of h1 (t) and
h2 (t). Since we already have a resultant for two linear polynomials (17.4), the resultant of our two
quadratic polynomials is
(a2 b1 ) (a2 b0 )

R(f, g) = (17.8)
(a2 b0 ) (a1 b0 )

Example We again compute the resultant of f (t) = t2 − 7t + 12 = (t − 3)(t − 4) and g(t) =


t2 − 3t + 2 = (t − 2)(t − 1), which we saw from (17.3) is equal to 12, but this time we use (??).

(a b ) (a2 b0 )
= R(f, g) = 4

−10
R(f, g) = 2 1 = −12 (17.9)

(a2 b0 ) (a1 b0 ) −10 22

We should here note that a resultant computed by (??) and a resultant computed using (17.8) can
differ by a sign, and that their absolute value will be equal if a2 = b2 = 1.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
192 Polynomial Resultants

17.3.4 Resultants of Degree-Three Polynomials


We illustrate by finding the resultant of two cubic polynomials

f (t) = a3 t3 + a2 t2 + a1 t + a0 g(t) = b3 t3 + b2 t2 + b1 t + b0 .

In other words, we want to determine whether there exists a value α such that f (α) = g(α) = 0
without having to actually find all roots of both polynomials and comparing. We begin by forming
three auxiliary polynomials h1 (t), h2 (t) and h3 (t) as follows:

h1 (t) = a3 g(t) − b3 f (t)


= (a3 b2 )t2 + (a3 b1 )t + (a3 b0 )

where (ai bj ) ≡ (ai bj − aj bi ) and

h2 (t) = (a3 t + a2 )g(t) − (b3 t + b2 )f (t)


= (a3 b1 )t2 + [(a3 b0 ) + (a2 b1 )]t + (a2 b0 )

h3 (t) = (a3 t2 + a2 t + a1 )g(t) − (b3 t2 + b2 t + b1 )f (t)


= (a3 b0 )t2 + (a2 b0 )t + (a1 b0 )

Note that if there exists a value α such that f (α) = g(α) = 0, then h1 (α) = h2 (α) = h3 (α) = 0.
We can therefore say that f (t) and g(t) have a common root if and only if the set of equations

(a3 b2 ) (a3 b1 ) (a3 b0 )  t2 


  
 (a3 b1 ) (a3 b0 ) + (a2 b1 ) (a2 b0 )  t = 0
(a3 b0 ) (a2 b0 ) (a1 b0 ) 1
 

has a solution. 1 However, we know from linear algebra that this set of homogeneous linear equations
can have a solution if and only if
(a3 b2 ) (a3 b1 ) (a3 b0 )

(a3 b1 ) (a3 b0 ) + (a2 b1 ) (a2 b0 ) = 0

(a3 b0 ) (a2 b0 ) (a1 b0 )

and therefore,
(a3 b2 ) (a3 b1 ) (a3 b0 )


R(f, g) = (a3 b1 ) (a3 b0 ) + (a2 b1 ) (a2 b0 )


(a3 b0 ) (a2 b0 ) (a1 b0 )

This same approach can be used to construct the resultant of polynomials of any degree.
Let’s try this resultant on a couple of examples. First, let f (t) = t3 − 2t2 + 3t + 1 and
g(t) = 2t3 + 3t2 − t + 4. For this case,
7 2

−7
R(f, g) = −7 −5 −11 = − 1611

2 −11 13
1 Actually, we have only shown that this is a necessary condition. The proof that it is also sufficient can be found

in [GSA84].

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Determining the Common Root 193

We aren’t so much interested in the actual numerical value of the resultant, just whether it equals
zero or not. In this case, R(f, g) = − 1611 6= 0, so we conclude that f (t) and g(t) do not have a
common root.
Consider next the pair of polynomials f (t) = t3 − t2 − 11t − 4 and g(t) = 2t3 − 7t2 − 5t+
4. In this case,
−5 17 12

R(f, g) = 17 −60 −32 = 0



12 −32 −64
Since R(f, g) = 0, f (t) and g(t) do have a common root. Note that the resultant simply determines
the existence or non-existence of a common root, but it does not directly reveal the value of a
common root, if one exists. In fact, if the resultant is zero, there may actually be several common
roots. Section 17.4 discusses how to compute the common root(s).

17.3.5 Resultants of Higher Degree Polynomials


The formulation of the resultant that we have presented is known as Bezout’s resultant. For two
polynomials of equal degree, Bezout’s resultant is the determinant of an n × n matrix. The pattern
you can observe in the resultants of degree two and degree three polynomials extends to any degree.
Resultants for two polynomials of different degree also exist.
Another formulation for resultants, called Sylvester’s resultant, is the determinant of a square
matrix of size 2n×2n. The pattern for Sylvester’s resultant is even easier to see. For two degree-three
polynomials, Sylvester’s resultant is
a3 a2 a1 a0 0 0

0 a3 a2 a1 a0 0

0 0 a3 a2 a1 a0

R(f, g) =
b3 b2 b1 b0 0 0


0 b3 b2 b1 b0 0
0 0 b3 b2 b1 b0

Sylvester’s resultant is equivalent to Bezout’s resultant. Clearly, Bezout’s resultant is more simple
to expand.

17.4 Determining the Common Root


We present two basic approaches to finding the common root of two polynomials: by solving a set
of linear equations, or by using Euclid’s algorithm.

Linear Equation Approach Our intuitive development of the resultant of two cubic polynomials
led us to a set of three linear equations in three “unknowns”: t2 , t and 1. In general, we could create
the resultant of two degree n polynomials f (t) = an tn + an−1 tn−1 + · · · + a1 t + a0 , g(t) = bn tn +
bn−1 tn−1 + · · · + b1 t + b0 , as the determinant of the coefficient matrix of n homogeneous linear
equations:  
  tn−1 
(an bn−1 ) . . . (an b0 ) 

 n−2 
 t
 

. . . . . 
 

 . 
 .  = 0


 . . . . . 
 . . . . .  
 t 
 
(an b0 ) . . . (a1 b0 ) 
 
1
 

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
194 Determining the Common Root

It may be a bit confusing at first to view this as a set of homogeneous linear equations, since the
unknowns are all powers of t. Let us temporarily switch to homogeneous variables T and U :
 
  T n−1 
(an bn−1 ) . . . (an b0 ) 

 
 T n−2 U 
. . . . .
  
 

 .

= 0

 . . . . . 
  .
. . . . .  

n−2

 TU
 
(an b0 ) . . . (a1 b0 ) 
 


U n−1
 

where t = T /U . After solving for any two adjacent terms T n−i U i−1 , the common root of f (t) and
n−i+1 i−2
g(t) can be obtained as t = TT n−i UUi−1 .

Cramer’s Rule There are several well known methods for solving for the T n−i U i−1 . One
way is to apply Cramer’s rule. A non-trivial solution exists (that is, a solution other than all
T n−i U i−1 = 0) only if the determinant of the matrix is zero. But, that implies that the n equations
are linearly dependent and we can discard one of them without losing any information. We discard
the last equation, and can then solve for n − 1 homogeneous equations in n homogeneous unknowns
using Cramer’s rule. It turns out that occasionally we run into trouble if we discard an equation
other than the last one. We illustrate Cramer’s rule for the case f (t) = t3 − t2 − 11t − 4 and
g(t) = 2t3 − 7t2 − 5t + 4. Recall that this is the pair for which we earlier found that R(f, g) = 0.
We have the set of equations

−5 17 12
  2 
 T 
 17 −60 −32  TU = 0
12 −32 −64
 2 
U

Discarding the last equation, we obtain


 
 T2 
17 12

−5
TU = 0
17 −60 −32  2 
U

from which we find the common root using Cramer’s rule:


−5 12


17 −32

TU
t = = − −5 17
= 4
U2
17 −60

Gauss Elimination A numerically superior algorithm for solving this set of equations is to
perform Gauss elimination. Two other advantages of Gauss elimination are that it can be used to
determine whether the determinant is zero to begin with, and also it reveals how many common
roots there are. We will illustrate this approach with three examples, using integer preserving Gauss
elimination. We choose the integer preserving Gauss elimination because then the lower right hand
element of the upper triangular matrix is the value of the determinant of the matrix.

Example 1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Determining the Common Root 195

Our first example is one we considered earlier: f (t) = t3 − 2t2 + 3t + 1 and g(t) = 2t3
+ 3t2 − t + 4. We set up the following set of linear equations, and triangularize the matrix using
integer preserving Gauss elimination:

7 2
  2 
−7  T 
 −7 −5 −11  TU =
2 −11 13
 2 
U

7 2
  2 
−7  T 
 0 −84 0  TU = 0
0 0
 2 
−1611 U
We observe that the only solution to this set of equations is T = U = 0, and conclude that f (t)
and g(t) do not have a common root. Note that the lower right element −1611 is the determinant
of the original matrix, or the resultant.

Example 2
We next examine the pair of polynomials f (t) = t3 − t2 − 11t − 4 and g(t) = 2t3 − 7t2 − 5t + 4.
In this case, we have
−5 17 12
  2 
 T 
 17 −60 −32  TU =
12 −32 −64
 2 
U
−5 17 12
  2 
 T 
 0 11 −44  TU = 0
0 0 0
 2 
U
Again, the bottom right element is the value of the determinant, which verifies that the resultant
is zero. It is now simple to compute the solution: T U = 4U 2 , T 2 = 4T U . Since t = T /U , the
common root is t = 4.

Example 3
For our final example we analyze the polynomials f (t) = t3 − 6t2 + 11t − 6 and g(t) = t3 − 7t2 + 14t − 8.
Our linear equations now are:

−1 3 −2  T 2  −1 3 −2  T 2 
     
 3 −9 6  TU =  0 0 0  TU = 0
−2 6 −4 0 0 0
 2   2 
U U

In this case, not only is the resultant zero, but the matrix is rank 1. This means that there are two
common roots, and they can be found as the solution to the quadratic equation −t2 + 3t − 2,
which is t = 1 and t = 2. Another way of saying this is that −t2 + 3t − 2 is the Greatest
Common Divisor of f (t) and g(t).

Euclid’s GCD Algorithm An alternative approach to finding the common root(s) of two poly-
nomials is to use Euclid’s algorithm. This ancient algorithm can be used to find the Greatest
Common Divisor of two integers or two polynomials. A clear proof of Euclid’s algorithm can be
found in [Kur80]. Our presentation consists of a series of examples. This algorithm works beautifully
in exact integer arithmetic but we have experienced numerical instability in floating point.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
196 Determining the Common Root

Integer Example
We illustrate first on a pair of integers: 42 and 30. For the first step, we assign the larger to be the
numerator, and the other to be the denominator:

Step 1: 42
30 = 1 remainder 12.

We now take the remainder of the first step and divide it into the denominator of the first step:

Step 2: 30
12 = 2 remainder 6.

We continue dividing the remainder of the preceding step into the denominator of the preceding
step until we obtain a zero remainder. This happens to occur in the third step for this problem:

Step 3: 12
6 = 2 exactly.

According to Euclid’s algorithm, the second to last remainder is the GCD. In this case, the second
to last remainder is 6, which is clearly the largest integer that evenly divides 30 and 42.

Polynomial Example 1
We illustrate how Euclid’s algorithm works for polynomials by using the same three exam-
ples we used in the previous section. For the polynomials f (t) = t3 − 2t2 + 3t + 1 and
g(t) = 2t3 + 3t2 − t + 4, we have:
2t3 + 3t2 − t + 4
• Step 1: t3 − 2t2 + 3t + 1 = 2 remainder 7t2 − 7t + 2.

t3 − 2t2 + 3t + 1
• Step 2: 7t2 − 7t + 2 = t − 1
7 remainder 12t+9
7

7t2 − 7t + 2
• Step 3: (12t + 9)/7 = 196t − 343
48 remainder 1253
16

(12t + 9)/7
• Step 4: 1253/16 = 192t
8771 + 144
8771 remainder 0.

In this case, the GCD is 16 ,


1253
which is merely a constant, and so f (t) and g(t) do not have a common
root.

Polynomial Example 2
We next analyze the polynomials f (t) = t3 − t2 − 11t − 4 and g(t) = 2t3 − 7t2 − 5t + 4:
2t3 − 7t2 − 5t + 4
• Step 1: t3 − t2 − 11t − 4 = 2 remainder −5t2 + 17t + 12.

t3 − t2 − 11t − 4
• Step 2: −5t2 + 17t + 12 = − 5t − 12
25 remainder −11t + 44
25

−5t2 + 17t + 12
• Step 3: (−11t + 44)/25 = 125t + 75
11 remainder 0.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Implicitization and Inversion 197

In this case, the GCD is −11t + 44


25 , and the common root is t = 4.

Polynomial Example 3
Finally, consider f (t) = t3 − 6t2 + 11t − 6 and g(t) = t3 − 7t2 + 14t − 8:
3
− 6t2 + 11t − 6
• Step 1: tt3 − 7t2 + 14t − 8 = 1 remainder t2 − 3t + 2

t3 − 7t2 + 14t − 8
• Step 2: t2 − 3t + 2 = t − 4 remainder 0.

The GCD is t2 − 3t + 2, and the common roots are the roots of the equation t2 − 3t + 2 = 0
which are t = 1 and t = 2.
You may have realized that there is a close connection between Euclid’s algorithm and resultants,
and obviously Euclid’s algorithm does everything for us that resultants do.
We are now prepared to apply these tools to the problems of implicitizing and inverting curves.

17.5 Implicitization and Inversion


We discussed in the previous section a tool for determining whether two polynomials have a common
x(t)
root. We want to apply that tool to converting the parametric equation of a curve given by x = w(t) ,
y(t)
y = w(t) into an implicit equation of the form f (x, y) = 0. We proceed by forming two auxiliary
polynomials:
p(x, t) = w(t)x − x(t) q(y, t) = w(t)y − y(t)
Note that p(x, t) = q(y, t) = 0 only for values of x, y, and t which satisfy the relationships
x(t) y(t)
x = w(t) and y = w(t) . View p(x, t) as a polynomial in t whose coefficients are linear in x, and
view q(y, t) as a polynomial in t whose coefficients are linear in y. If
n
X n
X n
X
x(t) = ai ti , y(t) = bi ti , w(t) = di ti
i = 0 i = 0 i = 0

then
p(x, t) = (dn x − an )tn + (dn−1 x − an−1 )tn−1 + · · ·
+ (d1 x − a1 )t + (d0 x − a0 )
q(y, t) = (dn y − bn )tn + (dn−1 y − bn−1 )tn−1 + · · ·
+ (d1 y − b1 )t + (d0 y − b0 )
If we now compute the resultant of p(x, t) and q(y, t), we do not arrive at a numerical value, but rather
a polynomial in x and y which we shall call f (x, y). Clearly, any (x, y) pair for which f (x, y) = 0
causes the resultant of p and q to be zero. But, if the resultant is zero, then we know that there
exists a value of t for which p(x, t) = q(y, t) = 0. In other words, all (x, y) for which f (x, y) = 0
lie on the parametric curve and therefore f (x, y) = 0 is the implicit equation of that curve. This
should be clarified by the following examples.

Implicitization Example 1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
198 Implicitization and Inversion

Let’s begin by applying this technique to the parabola we implicitized earlier using a brute force
method:
x = t2 + 1 y = t2 + 2t − 2.
We begin by forming p(x, t) = − t2 + (x − 1) and q(y, t) = − t2 − 2t + (y + 2). The resultant
of two quadratic polynomials a2 t2 + a1 t + a0 and b2 t2 + b1 t + b0 is
(a2 b1 ) (a2 b0 )

(a2 b0 ) (a1 b0 )

and so the resultant of p(x, t) and q(y, t) is

2 x − y − 3

R(p, q) = =

x−y−3 2x − 2

−x2 + 2xy − y 2 + 10x − 6y − 13


which is the implicit equation we arrived at earlier.
We can write an inversion equation for this curve – something which eluded us in our ad hoc
approach:
2 x−y−3
  
t
= 0
x−y−3 2x − 2 1
−x + y + 3
From which t = 2 or t = x−y−3 .
−2x + 2

Implicitization Example 2
We now implicitize the cubic curve for which

2t3 − 18t2 + 18t + 4


x =
−3t2 + 3t + 1
39t3 − 69t2 + 33t + 1
y =
−3t2 + 3t + 1
We begin by forming p(x, t) and q(y, t):

p(x, t) = − 2t3 + (−3x + 18)t2 + (3x − 18)t + (x − 4)

q(y, t) = − 39t3 + (−3y + 69)t2 + (3y − 33)t + (y − 1)


Recalling from Section 17.3 that the resultant of two cubic polynomials a3 t3 + a2 t2 + a1 t + a0
and b3 t3 + b2 t2 + b1 t + b0 is

(a3 b2 ) (a3 b1 ) (a3 b0 )




(a3 b1 ) (a3 b0 ) + (a2 b1 ) (a2 b0 )

,
(a3 b0 ) (a2 b0 ) (a1 b0 )

we have
R(p, q) = f (x, y) =
−117x + 6y + 564 117x − 6y − 636 39x − 2y − 154


117x − 6y − 636 2y + 494 + 6y + 258

−69x − −66x .
39x − 2y − 154 −66x + − 6y + 258 30x − 6y − 114

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Implicitization in Bézier Form 199

We can expand the determinant to get


f (x, y) = − 156195x3 + 60426x2 y − 7056xy 2 + 224y 3 +
2188998x2 − 562500xy + 33168y 2 − 10175796x + 1322088y +
15631624
We can obtain an inversion equation using Cramer’s rule:
(117x − 6y − 636) (39x − 2y − 154)

(−69x − 2y + 494) (−66x + 6y + 258)

T2
t = = −
(−117x + 69y + 564) (39x − 2y − 154)

TU
(117x − 6y − 636) (−66x + 6y + 258)
Alternately, we could use Gauss elimination to compute the parameter of a point on the curve.
Cramer’s rule has the appeal that it actually generates an equation.
We have intentionally carried out all computations in exact integer arithmetic to emphasize the
rational, non-iterative nature of implicitization and inversion. Since the coefficients of the implicit
equation are obtained from the coefficients of the parametric equations using only multiplication,
addition and subtraction, it is possible to obtain an implicit equation which precisely defines the
same point set as is defined by the parametric equations.

17.6 Implicitization in Bézier Form


From the paper [SP86a], a Bézier curve can be implicitized as follows. (Note that the value lij in
these notes is equivalent to the value Lj,k+1 in the paper).

A degree 2 Bézier curve can be implicitized:


l (x, y) l20 (x, y)

f (x, y) = 21

l20 (x, y) l10 (x, y)

and a degree 3 Bézier curve can be implicitized


l32 (x, y) l31 (x, y) l30 (x, y)


f (x, y) = l31 (x, y) l30 (x, y) + l21 (x, y) l20 (x, y)


l30 (x, y) l20 (x, y) l10 (x, y)

where
1

   x y
n n
lij (x, y) = 1

wi wj xi yi
i j
1

xj yj
with n the degree of the curve, and xi , yi , wi the coordinates and weight of the ith control point.
For a general degree n curve, the implicit equation is
Ln−1,n−1 (x, y) · · · L0,n−1 (x, y)

f (x, y) =

· · · · ·
Ln−1,0 (x, y) L0,0 (x, y)

· · ·
where X
Li,j = lkm .
m≤min(i,j)
k+m=i+j+1

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
200 Implicitization in Bézier Form

17.6.1 Inversion of Bézier Curves


Inversion is accomplished by solving a set of equations. For the degree-two case, we solve
l21 (x, y) l20 (x, y)
  
t
= 0. (17.10)
l20 (x, y) l10 (x, y) (1 − t)

For example, using the top and bottom rows of the matrix, we can compute two different inversion
equations:
l20 l10
t= , and t = . (17.11)
l20 − l21 l10 − l20
For the degree-three case, we have
l32 (x, y) l31 (x, y) l30 (x, y) 
 
t2


 l31 (x, y) l30 (x, y) + l21 (x, y) l20 (x, y)  t(1 − t) =0 (17.12)
l30 (x, y) l20 (x, y) l10 (x, y) (1 − t)2
 

from which we seek an inversion equation


f (x, y)
t= .
g(x, y)
where f (x, y) and g(x, y) are degree-two polynomials in x and y. It turns out that we can obtain an
inversion equation for which f (x, y) and g(x, y) are linear in x and y, as follows. If P1 , P2 , and P3
are not collinear, there exist constants c1 and c2 ,
x0 y0 1 x0 y0 1

w0 x1 y1 1 w0 x2 y2 1

x3 y3 1 x3 y3 1
c1 = x1 y1 1
, c2 = − x1 y1 1

3w2 x2 y2 1 3w1 x2 y2 1

x3 y3 1 x3 y3 1

such that if we multiple the first row of the matrix in (17.12) by c1 and the second row by c2 and
add them to the third row, we obtain
l32 (x, y) l31 (x, y) l30 (x, y) 
 
t2


 l31 (x, y) l30 (x, y) + l21 (x, y) l20 (x, y)  t(1 − t) =0 (17.13)
0 la (x, y) lb (x, y) (1 − t)2
 

where
la (x, y) = c1 l31 (x, y) + c2 [l30 (x, y) + l21 (x, y)] + l20 (x, y)
and
lb (x, y) = c1 l30 (x, y) + c2 l20 (x, y) + l10 (x, y).
The bottom row of (17.12.a) expresses the equation

la (x, y)t(1 − t) + lb (x, y)(1 − t)2 = 0 → la (x, y)t + lb (x, y)(1 − t) = 0

from which we can obtain an inversion equation


lb (x, y)
t= . (17.14)
lb (x, y) − la (x, y)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curve Inversion Using Linear Algebra 201

Example
Find an inversion equation for a polynomial Bézier curve with control points

P0 = (1, 0), P1 = (5, 0), P2 = (5, 2), P3 = (4, 3).

Solution
x y 1 1

x y
= 3 4 3 1 = 3x + 3y − 21, l31 = 3 4 3 1 = 9x + 3y − 45,

l32
5 2 1 5 0 1


x y 1 1

x y
l30 = 4 3 1 = 3x − 3y − 3, l21 = 9 5 2 1 = 18x − 90,


1 0 1 5 0 1
x y 1 y 1

x
l20 = 3 5 2 1 = 6x − 12y − 6, l10 = 3 5 0 1 = −12y.

1 0 1 1 0 1
1 0 1 1 0 1

5 0 1 5 2 1

4 3 1 4 3 1

c1 = = 2, c2 = − = −1
5 0 1 5 0 1

3 5 2 1 3 5 2 1
4 3 1 4 3 1
la (x, y) = c1 l31 (x, y) + c2 [l30 (x, y) + l21 (x, y)] + l20 (x, y) = 3x − 3y − 3
lb (x, y) = c1 l30 (x, y) + c2 l20 (x, y) + l10 (x, y) = −6y
So,
lb (x, y) −6y 2y
t= = = .
lb (x, y) − la (x, y) −3x − 3y + 3 x+y−1
Note that if we plug (1, 0) into the inversion equation, we obtain 0/0. That is because (1, 0) is a
double point on the curve, i.e., a point of self-intersection. There are actually two t values on the
curve that map to (1, 0): t = 0 and t = 2, as you can verify. At a double point, an inversion equation
will always give 0/0.

17.7 Curve Inversion Using Linear Algebra


We now present a simple approach to curve inversion that does not involve resultants. For a rational
curve of degree n, we can generally write the inversion equation in the form:

f (x, y)
t= (17.15)
g(x, y)

where f (x, y) and g(x, y) are polynomials of degree n − 2 if n > 2, and degree one if n = 2. Since
we are mainly interested in curves of degree two and three, f (x, y) and g(x, y) are just degree one
in those cases.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
202 Curve-Curve Intersections

Suppose we want to find the inversion equation for a rational cubic curve (in homogeneous form)

x(t) = x0 + x1 t + x2 t2 + x3 t3

y(t) = y0 + y1 t + y2 t2 + y3 t3
w(t) = w0 + w1 t + w2 t2 + w3 t3
Denote
f (x, y, w) = a2 x + b2 y + c2 w; g(x, y, w) = a1 x + b1 y + c1 w. (17.16)
To find an inversion equation for a cubic curve, we need just determine the coefficients a1 , a2 , b1 , b2 , c1 , c2
such that
f (x(t), y(t), w(t))
≡t (17.17)
g(x(t), y(t), w(t))
or
t · g(x(t), y(t), w(t)) − f (x(t), y(t), w(t)) ≡ 0 (17.18)
or

t · [a1 (x0 + x1 t + x2 t2 + x3 t3 ) + b1 (y0 + y1 t + y2 t2 + y3 t3 ) + c1 (w0 + w1 t + w2 t2 + w3 t3 )]


−[a2 (x0 + x1 t + x2 t2 + x3 t3 ) + b2 (y0 + y1 t + y2 t2 + y3 t3 ) + c2 (w0 + w1 t + w2 t2 + w3 t3 )] ≡ 0

or

t4 [a1 x3 + b1 y3 + c1 w3 ]
+t3 [a1 x2 + b1 y2 + c1 w2 − a2 x3 − b2 y3 − c2 w3 ]
+t2 [a1 x1 + b1 y1 + c1 w1 − a2 x2 − b2 y2 − c2 w2 ]
+t1
[a1 x0 + b1 y0 + c1 w0 − a2 x1 − b2 y1 − c2 w1 ]
+ [a2 x0 + b2 y0 + c2 w0 ] ≡ 0. (17.19)

This equation will be identically equal to zero if and only if all of the coefficients of the power of t
are all zero. Thus, we can solve for the ai , bi , and ci from the set of linear equations:

0
   
 a1
0 0 0

x3 y3 w3
 x2 y2 w2 −x3 −y3 −w3   b1   0 
   
  c1   0 
= (17.20)

 x1 y1 w1 −x2 −y2 −w2  
 x0 y0 w0 −x1 −y1 −w1   a2   0 

    
 b2   0 
0 0 0 −x0 −y0 −w0
c2 0

Of course, degree two curves are even more simple. Note that we can also find inversion equations
for 3D curves using this method.

17.8 Curve-Curve Intersections


Given one curve defined by the implicit equation f (x, y) = 0 and a second curve defined by the
parametric equations x = x(t), y = y(t), we replace all occurrences of x in the implicit equation
by x(t), and replace all occurrences of y in the implicit equation by y(t). These substitutions create
a polynomial f (x(t), y(t)) = g(t) whose roots are the parameter values of the points of intersection.
Of course, if we start off with two parametric curves, we can first implicitize one of them.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curve-Curve Intersections 203

3 4
9
2 5 8

1 6 7

Figure 17.1: Two cubic curves intersecting nine times

We illustrate this process by intersecting the curve

2t31 − 18t21 + 18t1 + 4


x =
−3t21 + 3t1 + 1

39t31 − 69t21 + 33t1 + 1


y =
−3t21 + 3t1 + 1
with the curve
−52t32 + 63t22 − 15t2 + 7
x =
−37t22 + 3t2 + 1
4
y =
−37t22 + 3t2 + 1
The two curves intersect nine times, which is the most that two cubic curves can intersect. 2 We
already implicitized the first curve (in Section 17.3), so our intersection problem requires us to make
−52t32 + 63t22 − 15t2 + 7
the substitutions x = −37t22 + 3t2 + 1
and y = −37t2 +4 3t2 + 1 into the implicit equation of
2
curve 1:
f (x, y) = − 156195x3 + 60426x2 y − 7056xy 2 + 224y 3 +
2188998x2 − 562500xy + 33168y 2 − 10175796x + 1322088y +
15631624.
After multiplying through by (−37t22 + 3t2 + 1)3 , we arrive at the intersection equation:

984100t92 − 458200t82 + 8868537t72 − 9420593t62 + 5949408t52


2 Bezout’s theorem states that two curves of degree m and n respectively, intersect in mn points, if we include

complex points, points at infinity, and multiple intersections.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
204 Surfaces

− 2282850t42 + 522890t32 − 67572t22 + 4401t2 − 109 = 0.


Again, we have carried out this process in exact integer arithmetic to emphasize that this equation
is an exact representation of the intersection points.
We now compute the roots of this degree 9 polynomial. Those roots are the parameter values
of the points of intersection. The (x, y) coordinates of those intersection points can be easily found
from the parametric equation of the second curve, and the parameter values on the first curve for
the intersection points can be found from the inversion equations. The results are tabulated below.

Intersection t1 Coordinates t2
Number Parameter of Point Parameter
of Curve 1 of Curve 2
1 0.0621 (4.2982,2.3787) 0.3489
2 0.1098 (4.4556,2.9718) 0.1330
3 0.1785 (4.6190,3.4127) 0.9389
4 0.3397 (4.9113,3.2894) 0.9219
5 0.4212 (4.9312,3.2186) 0.0889
6 0.6838 (5.1737,2.2902) 0.5339
7 0.8610 (5.4676,2.3212) 0.5944
8 0.9342 (5.6883,2.8773) 0.8463
9 0.9823 (5.9010,3.6148) 0.0369

The most common curve intersection algorithms are currently based on subdivision. Tests indicate
that this implicitization algorithm is faster than subdivision methods for curves of degree two and
three, and subdivision methods are faster for curves of degree five and greater [Sederberg et al ’86].

17.9 Surfaces
Implicitization and inversion algorithms exist for surfaces, also (see [Sederberg ’83] or [Sederberg et
al. ’84b]). But, whereas curve implicitization yields implicit equations of the same degree as the
parametric equations, surface implicitization experiences a degree explosion. A triangular surface
patch, whose parametric equations are of the form
i j i j
P P
i+j≤n xij s t i+j≤n yij s t
x = P i j
y = P i j
i+j≤n wij s t i+j≤n wij s t

zij si tj
P
i+j≤n
z = P i, j ≥ 0,
i+j≤n wij si tj

generally has an implicit equation of degree n2 . A tensor product surface patch, whose parametric
equations are of the form
Pn Pm i j
Pn Pm i j
i = 0 j = 0 xij s t i = 0 j = 0 yij s t
x = P n P m i j
y = P n P m i j
i = 0 j = 0 wij s t i = 0 j = 0 wij s t

Pn Pm i j
i = 0 j = 0 zij s t
z = Pn Pm i j
,
i = 0 j = 0 wij s t

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Base Points 205

generally has an implicit equation of degree 2mn. Thus, a bicubic patch generally has an implicit
equation f (x, y, z) = 0 of degree 18. Such an equation has 1330 terms!
Algebraic geometry shares important information on the nature of intersections of parametric
surfaces. Recall that Bezout’s theorem states that two surfaces of degree m and n respectively
intersect in a curve of degree mn. Thus, two bicubic patches generally intersect in a curve of degree
324.
We have noted that bilinear patches have an implicit equation of degree 2; quadratic patches
have an implicit equation of degree 4; biquadratic patches have an implicit equation of degree 8,
etc. It seems highly curious that there are gaps in this sequence of degrees. Are there no parametric
surfaces whose implicit equation is degree 3 or 5 for example? It turns out that parametric surfaces
of degree n only generally have implicit equations of degree n2 and that under certain conditions
that degree will decrease. To understand the nature of those conditions, we must understand why
the implicit equation of a parametric surface is generally n2 . The degree of a surface can be thought
of either as the degree of its implicit equation, or as the number of times it is intersected by a line.
Thus, the degree of the implicit equation of a parametric surface can be found by determining the
number of times it is intersected by a line. Consider a parametric surface given by
x(s, t) y(s, t) z(s, t)
x = y = z = ,
w(s, t) w(s, t) w(s, t)
where the polynomials are of degree n. One way we can compute the points at which a line intersects
the surface is by intersecting the surface with two planes which contain the line. If one plane is
Ax + By + Cz + Dw = 0, its intersection with the surface is a curve of degree n in s, t space:
Ax(s, t) + By(s, t) + Cz(s, t) + Dw(s, t) = 0. The second plane will also intersect the surface in
a degree n curve in parameter space. The points at which these two section curves intersect will be
the points at which the line intersects the surface. According the Bezout’s theorem, two curves of
degree n intersect in n2 points. Thus, the surface is generally of degree n2 .

17.10 Base Points


It may happen that there are values of s, t for which x(s, t) = y(s, t) = z(s, t) = w(s, t) = 0. These
are known as base points in contemporary algebraic geometry. If a base point exists, any plane
section curve will contain it. Therefore, it will belong to the set of intersection points of any pair of
section curves. However, since a base point maps to something that is undefined in x, y, z space, it
does not represent a point at which the straight line intersects the surface, and thus the existence
of a base point diminishes the degree of the implicit equation by one. Thus, if there happen to be r
base points on a degree n parametric surface, the degree of its implicit equation is n2 − r.
For example, it is well known that any quadric surface can be expressed in terms of degree 2
parametric equations. However, in general, a degree 2 parametric surface has an implicit equation
of degree 4, and we conclude that there must be two base points. Consider the parametric equations
of a sphere of radius r centered at the origin:
x = 2rsu
y = 2rtu
z = r(u2 − s2 − t2 )
w = s2 + t2 + u2
Homogeneous parameters s, t, u are used to enable us to verify the existence of the two base points:
s = 1, t = i, u = 0 and s = 1, t = −i, u = 0.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
206 Ideals and Varieties

17.11 Ideals and Varieties


This section presents a brief overview of ideals and varieties and suggests some ways how these topics
fit into CAGD. An excellent treatment of ideals and varieties and their application to CAGD can
be found in [CLO92].

17.11.1 Ideals of Integers


An ideal I of integers is an infinite set of integers such that, if a, b ∈ I, then a + b ∈ I and if c is any
integer, then c · a ∈ I. Ideals can be defined by a set of “generators” as follows. If {i1 , . . . , in } is a
set of integers, then we denote by
I = hi1 , i2 , . . . , in i
the ideal generated by {i1 , . . . , in }. This means that I is the infinite set of all integers that can be
expressed as c1 i1 + c2 i2 + . . . + cn in where the cj are integers. We refer to {i1 , . . . , in } as a generating
set of I.
For example, consider the ideal I = h6, 9i. Obviously, all members of the generating set belong
to the ideal: in this case, 6, 9 ∈ I. Also, zero belongs to every ideal. For this ideal, we can see that
21 ∈ I, because 21 = 6 · 2 + 9 · 1, and 3 ∈ I, because 3 = 2 · 6 − 1 · 9.
A powerful concept in ideal theory is that every ideal has more than one set of generators.
Theorem: Two ideals A = hi1 , . . . , in i and B = hj1 , . . . , jm i are equivalent if and only if

ik ∈ B, k = 1, . . . , n and jk ∈ A, k = 1, . . . , m.

The proof is straightforward.


From this theorem, we see that h6, 9i = h12, 15i because 6, 9 ∈ h12, 15i and 12, 15 ∈ h6, 9i. We
also see that h6, 9i = h3i! An ideal that can be generated by a single generator is called a principal
ideal. All ideals of integers are principal ideals. Furthermore, the single generator of A = hi1 , . . . , in i
is the greatest common divisor of i1 , . . . , in .

17.11.2 Ideals of Polynomials in One Variable


Given a set of polynomials in t with real coefficients {f1 (t), f2 (t), . . . fn (t)},

I = hf1 (t), f2 (t), . . . , fn (t)i

is the ideal generated by {f1 (t), f2 (t), . . . fn (t)} and is defined as the infinite set of polynomials in t
that can be created as f1 (t)g1 (t) + f2 (t)g2 (t) + . . . + fn (t)gn (t) where the gi (t) are any polynomials in
t with real coefficients. All ideals of polynomials in one variable are principle ideals, and the single
generator is the GCD of all polynomials in the ideal.

17.11.3 Polynomials in Several Variables


In general, a polynomial in n variables x1 , . . . , xn is defined
τ
e e
X
f (x1 , x2 , . . . , xn ) = ci x11,i x22,i · · · xenn,i . (17.21)
i=1
e e e e e e
Each summand ci x11,i x22,i · · · xnn,i is called a term, x11,i x22,i · · · xnn,i is a monomial, and ci is the
coefficient of the monomial. By convention, any given monomial occurs in at most one term in a
polynomial.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Ideals and Varieties 207

k[x1 , . . . , xn ] signifies the set of all polynomials in the variables x1 , . . . , xn whose coefficients
belong to a field k. For example, R[x, y] is the set of all polynomials
X
ci xe1,i y e2,i (17.22)

where ci ∈ R and e1,i , e2,i ∈ {0, 1, 2, . . .}. Thus, “f ∈ R[x, y, z]” means that f is a polynomial whose
variables are x, y and z and whose coefficients are real numbers. All polynomials in this chapter
have coefficients that are real numbers.

Term order
It is often useful to list the terms of a polynomial in decreasing order, beginning with the leading
term. This is done using a term order — a way to compare any two distinct terms of a polynomial
and declare which is “greater. ”
For linear polynomials, term order amounts to merely declaring an order on the variables. For
example, the terms of the polynomial
2x + 3y − 4z
are in proper order if we declare x > y > z. If we declare y > z > x, the proper order would be
3y − 4z + 2x. For non-linear polynomials, we begin by declaring an order on the variables, and
then we must also choose one of several schemes that decide how the exponents in a polynomial
influence term order. One such scheme is called lexicographical order (nicknamed lex), defined as
follows. If the variables of a polynomial are ordered x1 > x2 > . . . > xn , then given two distinct
e e e e e e
terms Ti = ci x11,i x22,i · · · xnn,i and Tj cj x11,j x22,j · · · xnn,j , Ti > Tj if
1. e1,i > e1,j , or if
2. e1,i = e1,j and e2,i > e2,j , or, in general, if
3. ek,i = ek,j for k = 1, . . . , m − 1 and em,i > em,j .
For example, the polynomial
3x2 y 2 z + 4xy 3 z 2 + 5x3 z + 6y 2 + 7xz 3 + 8
using lex with x > y > z would be written 5x3 z + 3x2 y 2 z + 4xy 3 z 2 + 7xz 3 + 6y 2 + 8 and its leading
term is 5x3 z. Using lex with z > x > y it would be written 7z 3 x + 4z 2 xy 3 + 5zx3 + 3zx2 y 2 + 6y 2 + 8
and the leading term would be 7z 3 x. Or using lex with y > z > x would be written 4y 3 z 2 x +
3y 2 zx2 + 6y 2 + 7z 3 x + 5zx3 + 8 and the leading term would be 4y 3 z 2 x.
Another choice for term order is the degree lexicographical order (abbreviated deglex). If the
variables are ordered x1 > x2 > . . . > xn , then using deglex, Ti > Tj if
1. e1,i + e2,i + . . . + en,i > e1,j + e2,j + . . . + en,j , or
2. e1,i + e2,i + . . . + en,i = e1,j + e2,j + . . . + en,j and Ti > Tj with respect to lex.
Using deglex with x > y > z, the terms of 3x2 y 2 z + 4xy 3 z 2 + 5x3 z + 6y 2 + 7xz 3 + 8 would be ordered
4xy 3 z 2 + 3x2 y 2 z + 5x3 z + 7xz 3 + 6y 2 + 8.
As obverved in the lex and deglex examples, term orders ignore the coefficient of a term, so a
term order might more properly be called a monomial order.
Other term orders can also be defined, such as degree reverse lexicographical order. The precise
requirements for any term order are discussed in reference [AL94], page 18.
The n-dimensional real affine space is denoted Rn and is the set of n-tuples:
Rn = (a1 , . . . , an ) : a1 , . . . , ak ∈ R (17.23)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
208 Ideals and Varieties

17.11.4 Polynomial Ideals and Varieties


The polynomial ideal generated by f1 , ..., fs ∈ k[x1 , ..., xn ], denoted hf1 , ..., fs i, is defined

I = hf1 , ..., fs i = {p1 f1 + ... + ps fs : pi ∈ k[x1 , ..., xn ]}. (17.24)

The polynomials f1 , ..., fs are called generators of this ideal. As in integer ideals, any polynomial
ideal can be defined using different generating sets.
Consider a set of polynomials f1 , f2 , · · · , fs ∈ k[x1 , ..., xn ]. Let (a1 , ..., an ) be a point in k n
satisfying fi (a1 , ..., an ) = 0, i = 1, ..., s. The set of all such points (a1 , ..., an ) is called the variety
defined by f1 , ..., fs , and is denoted by V (f1 , ..., fs ):

V (f1 , ..., fs ) = {(a1 , ..., an ) ∈ k n |fi (a1 , ..., an ) = 0, i = 0, . . . , s}. (17.25)

A more familiar way to refer to a variety is simply the set of solutions to a set of polynomial
equations.
A variety defined by a single polynomial—called a hypersurface—is the most familiar instance of a
variety. A hypersurface in R2 is a planar curve defined using an implicit equation, and a hypersurface
in R3 is what is normally called an implicit surface in CAGD. For example, V (x2 + y 2 − 1) is a
circle defined in terms of the implicit equation x2 + y 2 − 1 = 0 and V (2x + 4y − z + 1) is the plane
whose implicit equation is 2x + 4y − z + 1 = 0. A variety V (f1 , . . . , fs ) defined by more than one
polynomial (s > 1) is the intersection of the varieties V (f1 ) . . . V (fs ).
An ideal is a set of polynomials that is infinite in number. The variety of an ideal is the set of all
points (a1 , ..., an ) that make each polynomial in the ideal vanish. It is easy to see that the variety of
an ideal is the variety of generating set for the ideal. Two generating sets for the same ideal define
the same variety.
This is a very powerful concept, because some generating sets are more useful than others. For
example, consider the ideal

I = hx + y + z − 6, x − y − z, x − 2y + z − 3i

which can also be generated by hx − 3, y − 1, z − 2i. This second set of generators is much more
helpful, because we can immediately see that V (I) is x = 3, y = 1, z = 2. One method for converting
the generating set hx + y + z − 6, x − y − z, x − 2y + z − 3i into hx − 3, y − 1, z − 2i is to use the
familiar Gauss elimination method.
As another example, consider the ideal

I = ht4 − 3t3 + 4t2 − t − 4, t6 − 4t3 + 3i

An alternative generator for this ideal is simply ht − 1i, which can be obtained using Euclid’s
algorithm. Thus, t = 1 is the variety of this ideal, or, the common zero.
As we saw in our discussion of ideals of integers, necessary and sufficient conditions for hf1 , . . . , fn i =
hg1 , . . . , gm i are f1 , . . . , fn ∈ {g1 , . . . , gm } and g1 , . . . , gm ∈ {f1 , . . . , fn }. This general process can
be used to prove that Gauss elimination and Euclid’s algorithm, respectively, are algorithms that
create equivalent generating sets for ideals.

17.11.5 Gröbner Bases


Gauss elimination and Euclid’s algorithm create generating sets which make it simple to compute the
variety of an ideal (or, the set of all solutions to a set of polynomial equations). These algorithms are

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Ideals and Varieties 209

special cases of a completely general method for robustly finding all solutions to a set of polynomial
equations in any number of variables. This method is based on the notion of Gröbner bases.
A Gröbner basis of an ideal I is a set of polynomials {g1 , . . . , gt } such that the leading term of any
polynomial in I is divisible by the leading term of at least one of the polynomials g1 , . . . , gt . This, of
course, requires that a term order be fixed for determining the leading terms: different term orders
produce different Gröbner bases. Several excellent books have been written on Gröbner bases that
do not presuppose that the reader has an advanced degree in mathematics [CLO92, AL94, BW93]
A Gröbner basis is a particularly attractive set of generators for an ideal, as illustrated by two
familiar examples. If {f1 , . . . , fs } are polynomials in one variable, the Gröbner basis of hf1 , . . . , fn i
consists of a single polynomial: the GCD of f1 , . . . , fs . If {f1 , . . . , fs } are linear polynomials in several
variables, the Gröbner basis is an uppertriangular form of a set of linear equations. The Gröbner
basis of these special cases provides significant computational advantage and greater insight, and
the same is true of the Gröbner basis of a more general ideal.
Gröbner bases are the fruit of Bruno Buchberger’s Ph.D. thesis [Buc65], and are named in
honor of his thesis advisor. Buchberger devised an algorithm for computing Gröbner bases [Buc85,
CLO92]. Also, commercial software packages such as Maple and Mathematica include capabilities
for computing Gröbner bases.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
210 Ideals and Varieties

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 18

Implicitization using Moving Lines

This chapter presents a new way of looking at implicitization that has some geometric meaning. It
also shows how to express the determinant in more compact form, how to locate the double point
of a Béziercurve, and discusses the concept of duality.

18.1 Definition
A pencil of lines can be described by the equation

(a0 x + b0 y + c0 )(1 − t) + (a1 x + b1 y + c1 )t = 0 (18.1)

where the equations a0 x + b0 y + c0 = 0 and a1 x + b1 y + c1 = 0 define any two distinct lines.


It is known that any conic section can be “generated by the intersection of corresponding lines
of two related pencils in a plane” [Som51], p.388. In other words, given two distinct pencils,
(a00 x+b00 y+c00 )(1−t)+(a10 x+b10 y+c10 )t = 0 and (a01 x+b01 y+c01 )(1−t)+(a11 x+b11 y+c11 )t = 0,
to each value of t corresponds exactly one line from each pencil, and those two lines intersect in
a point. The locus of points thus created for −∞ ≤ t ≤ ∞ is a conic section, as illustrated in
Figure 18.1. This is reviewed in section 18.2.
This chapter examines the extension of that idea to higher degrees. A degree n family of lines
intersects a degree m family of lines in a curve of degree m + n, which is discussed in section 18.3.
Section 18.4 shows that any rational curve can be described as the intersection of two families of
lines, from which the multiple points and the implicit equation of the curve can be easily obtained.
For example, any cubic rational curve can be described as the intersection of a pencil of lines and a
quadratic family of lines. The pencil axis lies at the double point of the cubic curve. Section 18.5
discusses the family of lines which is tangent to a given rational curve. Such families of lines are
useful for analyzing the singularities of the curve, such as double points, cusps, and inflection points,
and also for calculating derivative directions.

18.1.1 Homogeneous Points and Lines


In projective geometry, the point whose homogeneous coordinates are (X, Y, W ) has Cartesian co-
ordinates (x, y) = (X/W, Y /W ). Of course, X, Y , and W cannot all be zero. The equation of a line
in homogenous form is
aX + bY + cW = 0 (18.2)

211
212 Definition

t=1 L
10 L01 t=0
0.75 0.25
0.5
0.5
0.25
0.75
t=0
L00 t=1
L11

Figure 18.1: Intersection of Two Pencils of Lines

(a, b, and c not all zero).


Given two triples, (a, b, c) and (d, e, f ), the operation of cross product is defined

(a, b, c) × (d, e, f ) = (bf − ec, dc − af, ae − db) (18.3)

and the dot product is defined

(a, b, c) · (d, e, f ) = ad + be + cf. (18.4)

In this chapter, all single characters in bold typeface signify a triple. In particular, the symbol
P denotes the triple (X, Y, W ), and L symbolizes the triple (a, b, c). When we refer to “the line L”,
we mean
{(X, Y, W )|L · P = (a, b, c) · (X, Y, W ) = aX + bY + cW = 0}. (18.5)
Thus, we can say that a point P lies on a line L = (a, b, c) if and only if P · L = 0.
The cross product has the following two applications: The line L containing two points P1 =
(X1 , Y1 , W1 ) and P2 = (X2 , Y2 , W2 ) is given by

L = P1 × P2 . (18.6)

The point P at which two lines L1 = (a1 , b1 , c1 ) and L2 = (a2 , b2 , c2 ) intersect is given by

P = L1 × L2 . (18.7)

This illustrates the principle of duality. Loosely speaking, general statements involving points and
lines can be expressed in a reciprocal way. For example, the statement “a unique line passes through
two distinct points” has a dual expression, “a unique point lies at the intersection of two distinct
lines”.
In general, any triple (α, β, γ) can be interpreted as a line ({(X, Y, W )| = αX + βY + γW = 0})
or as a point (whose Cartesian coordinates are ( αγ , βγ )). To remove the ambiguity, triples which are

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Definition 213

P
1/d
d

Line(!,",#)

Figure 18.2: Dual Point and Line

to be interpreted as points are preceded by the prefix ‘Point’ (i.e. Point(α, β, γ)), and triples which
signify lines are preceded by ‘Line’. The dual of Line(α, β, γ) is Point(α, β, γ), and vice versa. Dual
points and lines are related geometrically as follows:
• If d = √ γ
is the distance from Line(α, β, γ) to the origin, then 1/d is the distance from
α2 +β 2
Point(α, β, γ) to the origin.
• The line from the origin to Point(α, β, γ) is perpendicular to Line(α, β, γ).
This relationship is illustrated in Figure 18.2.
Discussion of the duals of Bézier and B-spline curves can be found in [Hos83, Sab87].

18.1.2 Curves and Moving Lines


A homogeneous point whose coordinates are functions of a variable is denoted by appending the
variable, enclosed in square brackets:

P[t] = (X[t], Y [t], W [t]) (18.8)

which amounts to the rational curve


X[t] Y [t]
x= ; y= . (18.9)
W [t] W [t]
If these functions are polynomials in Bernstein form
n
X n
X n
X
X[t] = Xi Bin [t]; Y [t] = Yi Bin [t]; W [t] = Wi Bin [t] (18.10)
i=0 i=0 i=0

with Bin [t] = n


(1 − t)n−i ti , then equation (18.8) defines a rational Bézier curve

i
n
X
P[t] = Pi Bin [t] (18.11)
i=0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
214 Pencils and Quadratic Curves

with homogeneous control points Pi = (Xi , Yi , Wi ). Customarily, these control points are thought of
as having Cartesian coordinates ( W , ) with weights Wi . If W [t] ≡ γ, that is, if W [t] is a constant,
X i Yi
i Wi
then the curve is referred to as a polynomial curve. This happens if W0 = W1 = . . . = Wn = γ.
In this chapter, the word curve generally means rational curve unless it is referred to as polynomial
curve.
Likewise,
L[t] = (a[t], b[t], c[t]) (18.12)
denotes the family of lines
a[t]x + b[t]y + c[t] = 0. (18.13)
Such a family of lines is traditionally known as a pencil of lines if a[t], b[t], and c[t] are linear functions
of t. In the general case, [Win23] refers to families of lines as line equations, and families of points
(i.e., curves) as point equations. In this chapter, it is more comfortable to refer to a parametric
family of lines as in equation (18.12) as a moving line. Also, a curve P[t] will be referred to as a
moving point when the varying position of point P[t] is of interest.
A moving point P[t] follows a moving line L[t] (or, equivalently, the moving line follows the
moving point) if
P[t] · L[t] ≡ 0, (18.14)
that is, if point P[t] lies on line L[t] for all values of t. Two moving points P1 [t] and P2 [t] follow a
moving line L[t] if
P1 [t] × P2 [t] ≡ L[t]k[t] (18.15)
where k[t] is a scalar rational function of degree zero or greater. Two moving lines L1 [t] and L2 [t]
intersect at a moving point P[t] if

L1 [t] × L2 [t] ≡ P[t]k[t]. (18.16)

18.1.3 Weights and Equivalency


Two homogeneous points (X1 , Y1 , W1 ) and (X2 , Y2 , W2 ) represent the same point in Cartesian coor-
dinates (X1 /W1 , Y1 /W1 ) = (X2 /W2 , Y2 /W2 ) if and only if (X1 , Y1 , W1 ) = k(X2 , Y2 , W2 ) where k is
a non-zero constant. Likewise, lines L1 and L2 are the same if and only if L1 = kL2 . This fact can
be extended to curves and moving lines. For example, two curves P1 [t] and P2 [t] are equivalent if
P1 [t] ≡ k[t]P2 [t] where k[t] is a scalar rational function of t. Two curves with identical shape are
not equivalent if the parametrizations are different each other.
Even though two homogeneous points (or lines) may map to the same Cartesian point (or line),
they do not always create identical results. For example, a control point Pi of a rational curve as
in equation (18.11) cannot be replaced with a scale of itself without altering the curve, for scaling
would change its weight. Of course, if all the control points were scaled by the same value, the curve
would be unchanged.

18.2 Pencils and Quadratic Curves


18.2.1 Pencils of lines
Given any two lines L0 = (a0 , b0 , c0 ) and L1 = (a1 , b1 , c1 ), a pencil of lines L[t] can be expressed

L[t] = L0 (1 − t) + L1 t. (18.17)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Pencils and Quadratic Curves 215

L1
t=1
P1
0.75

d1 0.5
0.25
P0 L0
A t=0

d0 Parameter Lin

Figure 18.3: Pencil of Lines

All lines in the pencil contain the point at which L0 and L1 intersect. We will refer to this point
as the pencil axis. There is a one-to-one correspondence between lines in the pencil and parameter
values t.
The rate at which the moving line L[t] rotates about its axis as t varies is most easily visualized
by introducing a parameter line as shown in Figure 18.3. The parameter line is a degree 1 polynomial
Bézier curve
P[t] = (1 − t)P0 + tP (18.18)
which follows L[t]. P0 lies on L0 a distance d0 from the axis, and P1 lies on L1 a distance d1 from
the axis where
a2 + b20
p
d0
= p 02 . (18.19)
d1 a1 + b21
If L[t] is to rotate counter clockwise as t increases, then

a0 b1 > a1 b0 . (18.20)

If parameter values are marked off evenly along the parameter line as shown, the line L[t] passes
through the parameter line at the point corresponding to t.
Notice that d0 and d1 control the rate at which L[t] rotates. Figure 18.4 shows an example
in which d0 is larger than d1 , with the effect that lines defined by evenly spaced increments are
concentrated near L0 .
An alternate way to specify a pencil of lines is with an axis PA = (XA , YA , WA ) and a rational
linear Bézier curve

P[t] = P0 (1 − t) + P1 t = (X0 , Y0 , W0 )(1 − t) + (X1 , Y1 , W1 )t. (18.21)

A pencil L[t] can then be defined as the set of lines connecting PA with points on P[t]:

L[t] = PA × P[t] = PA × (P0 (1 − t) + P1 t). (18.22)

This representation of a pencil is related to the representation in equation (18.17). The two lines
L0 and L1 can be expressed

L0 = PA × P0
L1 = PA × P1 (18.23)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
216 Pencils and Quadratic Curves

L1

t=1 0.9
0.8
0.7
0.6
0.5
0.4
d1 0.3
0.2
0.1 L0
t=0
A
d0 Parameter Line

Figure 18.4: Pencil of Lines

and the parameter line is positioned with distances d0 and d1 which satisfy
d0 PA P0 W0
= , (18.24)
d1 PA P1 W1
as shown in Figure 18.5. Thus, we see that every pencil of lines follows a degree one polynomial
curve.

18.2.2 Intersection of Two Pencils


Consider what happens when two pencils of lines intersect, line by line. Figure 18.6 shows two
pencils
L0 [t] = L00 (1 − t) + L01 t
L1 [t] = L10 (1 − t) + L11 t, (18.25)
and the points at which they intersect for parameter values t = 0, .25, .5, .75, 1. It is clear that those
five sample points are not collinear, and in fact as t varies continuously from 0 to 1, the two pencils
intersect in a smooth curve as shown. This curve turns out to be a conic section, which can be
expressed as a rational Bézier curve P[t] as follows.
P[t] = L0 [t] × L1 [t]
= (L00 (1 − t) + L01 t) × (L10 (1 − t) + L11 t)
1
= (L00 × L10 )(1 − t)2 + (L00 × L11 + L01 × L10 )2(1 − t)t + (L01 × L11 )t2 , (18.26)
2
which expresses P[t] as a quadratic rational Bézier curve whose control points are:
P0 = L00 × L10
1
P1 = (L00 × L11 + L01 × L10 ) (18.27)
2
P2 = L01 × L11 .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Pencils and Quadratic Curves 217

L1
t=1
0.9
0.8
W1=2
d1 0.7
P1
0.6
0.5
.5d1 0.4
0.3
A 0.2
0.1 t=0 L0
d0 P0
W0=1
Parameter Line

Figure 18.5: Pencil of Lines

L00
L10
0.25 t=0
0.75 0.5
t=1
t=0
0.25
L01 0.5
0.75
t=1
L11

Figure 18.6: Intersection of Two Pencils of Lines

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
218 Pencils and Quadratic Curves

L10
!0 L00

P0
L01
Pb
P1
!1
Pa
P2 L11

Figure 18.7: Rational Quadratic Curve

The geometric relation between the control points and weights are shown in Figure 18.7. Control
point
q P0 lies at the intersection of L00 and L10 and has a weight of d00 d10 sin(θ0 ), where dij =
a2ij + b2ij . Control point P2 lies at the intersection of L01 and L11 and has a weight of d01 d11 sin(θ1 ).
Control point P1 and its weight is computed using the auxiliary points Pa and Pb which are the
intersection of L00 and L11 , and L01 and L10 , respectively.
The two pencils of lines provide a useful intermediate representation of a conic section, from
which the implicit equation and parametric equations can be derived with equal ease. The implicit
equation can be found by eliminating the pencil parameter t from the two pencil equations

L00 (1 − t) + L10 t = 0
L10 (1 − t) + L11 t = 0 (18.28)

where
Lij = Lij · P = aij X + bij Y + cij W. (18.29)
In matrix form,
1−t
  
L00 L01
=0 (18.30)
L10 L11 t
from which the implicit equation of the intersection locus is

L00 L11 − L01 L10 = 0. (18.31)

18.2.3 Pencils on Quadratic Curves


An arbitrary rational quadratic Bézier curve

P[t] = P0 (1 − t)2 + P1 2(1 − t)t + P2 t2 (18.32)

can be represented as the intersection of two pencils. Consider a moving line L[t] which goes
through a certain fixed point P[k] on the curve and follows the moving point P[t]. This moving line

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Pencils and Quadratic Curves 219

Pa Pb
t=0 t=1 2d
2) 0.1 0.9 12
w1/w 0.2 0.8 (w
( 1/w
01 P1 0.3 0.7 P1
2d 0.4 0.6 0)
1 0.5 0.5 d1
d0 0.6 0.4 2
0.7 0.3
0.8 0.2
0.9 0.1
P0 Pt=1
2
t=0
P0 P2

Figure 18.8: Quadratic Bézier Curve

is expressed as follows.

L[t] = P[k] × P[t]


= (P0 (1 − k)2 + P1 2(1 − k)k + P2 k 2 ) × (P0 (1 − t)2 + P1 2(1 − t)t + P2 t2 )
2P0 × P1 P0 × P2 1−t
  
= (t − k) 1 − k k (18.33)

,
P0 × P2 2P1 × P2 t

from which this L[t] is always equivalent to a linear moving line (i.e. a pencil). Thus, two pencils
can be found by choosing arbitrary two parameter values k0 and k1 and calculating P[ki ] × P[t].
The simplest example is k0 = 0, k1 = 1. In this case,

P[0] × P[t] = t [P0 × (2P1 (1 − t) + P2 t)]


P[1] × P[t] = (1 − t) [P2 × (P0 (1 − t) + 2P1 t)] , (18.34)

from which the two pencils intersecting at the moving point P[t] are

L0 = P0 × (2P1 (1 − t) + P2 t)
L1 = P2 × (P0 (1 − t) + 2P1 t). (18.35)

Figure 18.8 shows the geometric relationship. The parameter lines of pencils L0 [t] and L1 [t] are
Pa P2 and P0 Pb , respectively, where
2w1
P0 Pa = P0 P1 ,
w2
2w1
P2 Pb = P2 P1 . (18.36)
w0
These parameter lines have the property of a nomogram. Consider a point Pp on the curve. If
the line P0 Pp intersects the parameter line Pa P2 at the point Pq , then the parameter value t at
Pp can be found as
Pa Pq
t= . (18.37)
Pa P2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
220 Moving Lines

18.3 Moving Lines


18.3.1 Bernstein Form
In equation (18.12), if the polynomials a[t], b[t], and c[t] are of degree n, one way to define the
moving line L[t] is to use n + 1 control lines Li where
n
X
L[t] = Li Bin [t]. (18.38)
i=0

Since this is the dual of a Bézier curve, it has many nice properties. For example, L[t] moves from
L0 to Ln when t is changing from 0 to 1. The line L[τ ] for any parameter value τ can be calculated
using the de Casteljau algorithm. Denote

L<k>
i [τ ] = (1 − τ )L<k−1>
i [τ ] + τ L<k−1>
i+1 [τ ] (18.39)

where
L<0>
i [τ ] = Li . (18.40)
Then, L<n>
0 [τ ]
is the required line L[τ ]. This algorithm also subdivides the moving line in the same
way as for a Bézier curve.

18.3.2 Moving Line which Follows Two Moving Points


Consider two moving points P[t] and Q[t] of degree m and n respectively. The moving line L[t] that
follows the two moving points is
L[t] = P[t] × Q[t], (18.41)
and its degree is generally m + n. If P[t] and Q[t] are Bézier curves
m
X
P[t] = Bim [t]Pi
i=0
n
X
Q[t] = Bjn [t]Qj , (18.42)
j=0

then the control lines Lk of the moving line are expressed as follows:
m+n
X
L[t] = Bkm+n [t]Lk (18.43)
k=0
1 X  m  n 
Lk = Pi × Qj . (18.44)
m+n
 
i j
i+j=k
k

For example, if a moving line L[t] follows a degree one moving point

P[t] = P0 (1 − t) + P1 t (18.45)

and a degree two moving point

Q[t] = Q0 (1 − t)2 + Q1 2(1 − t)t + Q2 t2 , (18.46)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Moving Lines 221

Q0
L0
P0 Q1
L1

L2 P1 L
3
Q2

Figure 18.9: Cubic Moving Line which Follow Linear and Quadratic Moving Points

then L[t] is a cubic moving line with control lines

L0 = P0 × Q0
1
L1 = (2P0 × Q1 + P1 × Q0 )
3
1
L2 = (P0 × Q2 + 2P1 × Q1 ) (18.47)
3
L3 = P1 × Q2 .

The relationship between the control lines and the control points is shown in Figure 18.9.

18.3.3 Intersection of Two Moving Lines


Two moving lines L0 [t] and L1 [t] of degree m and n respectively, intersect at a moving point

P[t] = L0 [t] × L1 [t], (18.48)

whose degree is generally m + n. This is the dual of what we discussed in section 18.3.2. Therefore,
the relationship between the control lines of L0 [t] and L1 [t] and the control points of P[t] is

1 X  m  n 
Pk = L0i × L1j . (18.49)
m+n
 
i j
i+j=k
k

Figure 18.10 shows an example of cubic moving point P[t] which is the intersection of a pencil
L0 [t] and a quadratic moving line L1 [t]. Notice that each control point of P[t] can be calculated

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
222 Moving Lines

L10
L00 P0
L11
L01 P1

P2 L12

P3

Figure 18.10: Intersection of Linear and Quadratic Moving Lines

from intersection(s) of the control lines as follows:

P0 = L00 × L10
1
P1 = (2L00 × L11 + L01 × L10 )
3
1
P2 = (L00 × L12 + 2L01 × L11 ) (18.50)
3
P3 = L01 × L12 .

18.3.4 Base Points


Any parameter value t for which P[t] = (0, 0, 0) or L[t] = (0, 0, 0) is called a base point. Any curve or
moving line which has a base point can be replaced by an equivalent curve or moving line of degree
one less. For example, if for some parameter value t = τ , P[τ ] = (0, 0, 0), then t − τ would be a
factor of X[t], Y [t], and W [t] and we could divide out that factor to get

X[t] Y [t] W [t]


P[t] = (t − τ )( , , ). (18.51)
t−τ t−τ t−τ

In equation (18.41), assume P and Q have no base points themselves. Then, the degree of L[t]
is generally m + n. The degree will be less than m + n only if L has a base point. This can only
happen if there exists a value τ such that P[τ ] × Q[τ ] = (0, 0, 0), which can only happen if at one of
the m × n points at which P and Q intersect, both curves have the same parameter value τ . Thus,
the degree of L is m + n − r where r is the number of base points. The same thing happens in
equation (18.48).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curve Representation with Two Moving Lines 223

18.3.5 Axial Moving Lines


Moving lines of degree n > 1 generally have no axis, that is, no single point about which the line
rotates. The special case in which a moving line does have an axis will be referred to as an axial
moving line. A degree n axial moving line L[t] can be expressed

L[t] = PA × P[t] (18.52)

where PA is the axis and a P[t] is a degree n curve. An axial moving line can be thought of as
following a degree 0 moving point (i.e. a fixed point) and a degree n moving point (i.e. curve). The
relationship between the control lines of the axial moving line and the control points of the curve is

Li = PA × Pi . (18.53)

Notice that all the control lines Li of the axial pencil go through the axis.

18.4 Curve Representation with Two Moving Lines


18.4.1 Axial Moving Line on a Curve
Consider an axial moving line L[t] which follows a degree n Bézier curve P[t]:

L[t] = PA × P[t]. (18.54)

Though the degree of this moving line is generally n, it can always be reduced to degree n − 1 if the
axis lies on the curve
PA = P[τ ], (18.55)
because then the moving line has a base point.
We have already confirmed this fact for quadratic Bézier curves in section 18.2.2. For cubic
Béziers,

L[t] = P[τ ] × P[t]


= (t − τ ) (1 − τ )2 (1 − τ )τ τ 2


3P0 × P1 3P0 × P2 P0 × P3  (1 − t)2 


  
 3P0 × P2 P0 × P3 + 9P1 × P2 3P1 × P3  (1 − t)t (18.56)
P0 × P3 3P1 × P3 3P2 × P3 t2
 

where Pi (i = 0, 1, 2, 3) are the control points of the Bézier curve. In general,

L[t] = (t − τ ) (1 − τ )n−1 (1 − τ )n−2 τ ... τ n−1




L0,0 L0,1 L0,n−1 (1 − t)n−1


  
...  
 L1,0 L1,1 L1,n−1  (1 − t)n−2 t
 
...
 
(18.57)

: : ::: : :

   
Ln−1,0 Ln−1,1 ... Ln−1,n−1
 
tn−1
 

where   
X n n
Li,j = Pl × Pm (18.58)
l m
l+m=i+j+1

Notice that the determinant of the n × n matrix is equivalent to the Bezout’s resultant which gives
the implicit equation of the curve.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
224 Curve Representation with Two Moving Lines

P2=(1,2,1)

P1=(0,1,1)

P0=(0,0,1)
P3=(3,0,1)

Figure 18.11: Cubic Bézier Curve

18.4.2 Axial Moving Line on a Double Point


Consider what is happening when the axis is on a double point of a degree n curve. Since the curve
P[t] goes through the axis twice at certain parameter values t = τ0 , τ1 (which may be imaginary),
the moving line has two base points
L[τ0 ] = L[τ1 ] = 0. (18.59)
Therefore, the degree of the axial moving line is reducible to n − 2. In general, if the axis is on a
point of multiplicity m, then the degree of the axial moving line which follows the degree n curve is
n − m.
Figure 18.11 shows an example of a cubic curve. This cubic Bézier curve has a double point at
P3 . Thus the axial moving line with the axis P3 is a pencil:
L[t] = P3 × P[t]
= (3, 0, 1) × (0, 0, 1)(1 − t)3 + (0, 1, 1)3(1 − t)2 t + (1, 2, 1)3(1 − t)t2 + (3, 0, 1)t3


= (t − 1)(3t2 + 3t, 3t + 3, −9t2 − 9t)


= (t − 1)(t + 1)(3t, 3, −9t)
= (t − 1)(t + 1) {(0, 3, 0)(1 − t) + (3, 3, −9)t} . (18.60)
Two roots of L[t] = 0 shows the type of the double point. In this case, it has two distinct real roots
t = ±1, so the double point is a crunode. If the two roots are identical or imaginary, then the double
point is a cusp or an acnode, respectively.

18.4.3 Cubic Curves


For any rational cubic Bézier curve, we can find a pencil and a quadratic moving line which intersects
at the moving point. Let us calculate them for the example of Figure 18.11. First of all, make axial
moving lines which follow the moving point by using equation (18.56)
P[τ ] × P[t] = (t − τ ) (1 − τ )2 (1 − τ )τ τ 2


(−3, 0, 0) (−6, 3, 0) (0, 3, 0)  (1 − t)2 


  
 (−6, 3, 0) (−9, 12, −9) (3, 9, −9)  (1 − t)t . (18.61)
(0, 3, 0) (3, 9, −9) (6, 6, −18) t2
 

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curve Representation with Two Moving Lines 225

Since this moving line follows the moving point P[t] for any τ , the following equation is obtained

(−3, 0, 0) (−6, 3, 0) (0, 3, 0)  (1 − t)2   0 


    
 (−6, 3, 0) (−9, 12, −9) (3, 9, −9)  (1 − t)t · P[t] = 0 . (18.62)
(0, 3, 0) (3, 9, −9) (6, 6, −18) t2 0
   

In this equation, each row of the matrix is a quadratic moving line that follows the moving point,
and any linear combination of these three moving line also follow the moving point. Thus we can
make linear operations between the three rows. Since the left most three elements of the matrix
shows three lines which intersect at the same point P0 , we can zero out the bottom left corner of
the matrix

(−3, 0, 0) (−6, 3, 0) (0, 3, 0)  (1 − t)2   0 


    
 (−6, 3, 0) (−9, 12, −9) (3, 9, −9)  (1 − t)t · P[t] = 0 . (18.63)
(0, 0, 0) (0, 3, 0) (3, 3, −9) t2 0
   

Now the bottom moving line has a base point at t = 0 and it is reducible to a linear moving line

1−t 0
   
(0, 3, 0) (3, 3, −9) · P[t] = (18.64)
 
.
t 0

As a result, this pencil and one of the three quadratic moving lines are the required two moving
lines

L0 [t] = (0, 3, 0)(1 − t) + (3, 3, −9)t


L1 [t] = (−6, 3, 0)(1 − t)2 + (−9, 12, −9)(1 − t)t + (3, 9, −9)t2 . (18.65)

Notice that the axis of the pencil always lies at the double point of the cubic curve. It can be
calculated from the two control lines. In this example,

(0, 3, 0) × (3, 3, −9) = (−27, 0, −9)


= −9(3, 0, 1), (18.66)

from which the double point is (3, 0).

18.4.4 Quartic Curves


Any rational quartic Bézier curve can be expressed either with two quadratic moving lines, or with
one linear and one cubic moving line. We can apply the same approach as in section 18.4.3.
Figure 18.12 shows a sample quartic Bézier curve, with the curve plotted beyond the traditional
[0, 1] parameter interval. First of all, using equation (18.57), calculate four cubic moving lines which
follow the curve by

(−4, 0, 0) (−12, 6, 0) (−8, 12, 0) (0, 3, 0) (1 − t)3  0 


    
 
 (−12, 6, 0) (−32, 36, −24) (−16, 50, −48) (3, 9, −9)  (1 − t)2 t 0

 
 
 

 (−8, 12, 0) (−16, 50, −48) (4, 56, −104) · P[t] = .
(12, 6, −24)   (1 − t)t2  0 
 

(0, 2, 0) (4, 8, −8) (12, 6, −24) (8, −4, −16) 0
   
t3
   
(18.67)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
226 Curve Representation with Two Moving Lines

P2=(1,2,1)
P3=(3,2,1)

P1=(0,1,1)

P0=(0,0,1)
P4=(2,0,1)

Figure 18.12: Quartic Bézier Curve

In this 4 × 4 matrix, the left most elements of the bottom two rows can be eliminated by applying
row operations
(−4, 0, 0) (−12, 6, 0) (−8, 12, 0) (0, 3, 0) (1 − t)3  0 
    
 
 (−12, 6, 0) (−32, 36, −24) (−16, 50, −48) (3, 9, −9)   (1 − t)2 t  0
  
 

 (0, 0, 0) · P[t] = ,
(0, 2, 0) (4, 4, −8) (4, −2, −8)   (1 − t)t  0 
  2

(0, 0, 0) (8, 6, 0) (28, 4, −24) (20, −14, −40) 0
 3
  
t
   
(18.68)
from which we can obtain two quadratic moving lines
  (1 − t)2 
 
(0, 2, 0) (4, 4, −8) (4, −2, −8) 0
  
(1 − t)t · P[t] = (18.69)
(8, 6, 0) (28, 4, −24) (20, −14, −40)  0
t2

that follow the curve, and hence which intersect at the curve.
Any linear combination of these two quadratic moving lines is also a quadratic moving line that
follows the curve. If the moving line is axial, then the axis is a double point. Any rational quartic
curve has three double points, which may possibly coalesce to form one triple point. In the case of
three distinct double points, their locations can be obtained by following method. Let LQ [t] be a
linear combination of the two moving lines:
  (1 − t)2 
 
(0, 2, 0) (4, 4, −8) (4, −2, −8)

LQ [t] = 1−τ τ (1 − t)t (18.70)

(8, 6, 0) (28, 4, −24) (20, −14, −40) 
t2

= (8τ, 4τ + 2, 0)(1 − t)2 + (24τ + 4, 4, −16τ − 8)(1 − t)t + (16τ + 4, −12τ − 2, −32τ (18.71)
− 8)t2 .
If it is axial, three control lines must intersect at one point. This condition is expressed with the
following equation
(8τ, 4τ + 2, 0) × (24τ + 4, 4, −16τ − 8) · (16τ + 4, −12τ − 2, −32τ − 8) = 0 (18.72)
32τ 3 − 32τ 2 − 8τ = 0

1± 2
τ = 0, .
2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curve Representation with Two Moving Lines 227

P2=(1,2,1)
P3=(3,2,1)

P1=(0,1,1)

P0=(0,0,1)

P4=(3,-2,1)

Figure 18.13: Quartic Bézier Curve with a Triple Point

Three double points can be obtained by calculating the axis of LQ [t]

−1(2, 0, 1) (τ = 0) √

(8τ, 4τ + 2, 0) × (24τ + 4, 4, −16τ − 8) = √ √ (18.73)
(−12 ∓ 8 2)(1, ∓ 2, 1) (τ = 1±2 2 ),

from which the double points are (2, 0) and (1, ± 2).
If there is a triple point on the curve, however, there is no pair of quadratic moving lines that
can represent the curve. Figure 18.13 is an example quartic Bézier curve with a triple point at P4 .
We can obtain four cubic moving lines that follow the curve

(−4, 0, 0) (−12, 6, 0) (−8, 12, 0) (2, 3, 0)  (1 − t)2   0 


  3
  
 
 (−12, 6, 0) (−32, 36, −24) (−14, 51, −48) (12, 12, −12)  (1 0
 
− t) t
   
 (−8, 12, 0) (−14, 51, −48) (12, 60, −108) (24, 12, −48)   (1 − t)t2  · P[t] = ,
0 
 

(2, 3, 0) (12, 12, −12) (24, 12, −48) (16, 0, −48) 0
   
t3
   
(18.74)
form which we can get two quadratic moving lines
  (1 − t)2   0 
   
(2, 3, 0) (8, 6, −12) (8, 0, −24)

(1 − t)t · P[t] = 0 . (18.75)
(8, 12, 0) (30, 21, −48) (28, 0, −84) 
t2 0
  

These two quadratic moving lines (call them L1 and L2 ) are linearly independent, but their inter-
section does not express the curve because all control points obtained from L1 × L2 are (0, 0, 0).
This means that both moving lines have exactly the same rotation, but their weights are different.
In fact, each of them has a base point and both are identical to the same pencil. The pencil can be
obtained by eliminating the bottom left element

  (1 − t)   0 
 2
  

(0, 0, 0) (2, 3, 0) (−4, 0, 12) (1 − t)t · P[t] = 0 (18.76)



.
t2 0
   

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
228 Curve Representation with Two Moving Lines

As a result, the curve can be expressed as the intersection of this pencil and one of the cubic moving
lines. The axis of the pencil is

(2, 3, 0) × (−4, 0, 12) = (36, −24, 12)


= 12(3, −2, 1) (18.77)

and thus, the triple point is (3, −2) .


Notice that a quartic curve with a triple point cannot be expressed as the intersection of two
quadratic moving lines. If it were possible, there would be three quadratic moving lines that are
linearly independent. In that case, they could represent a cubic curve.

18.4.5 General Case


The methods for cubic and quartic curves can be extended to higher degree curves. For a degree n
curve, there exists an n parameter family of moving lines whose degree is n − 1. A basis for that
family of moving lines is given by

L0,0 L0,1 L0,n−1 (1 − t)n−1  0 


    
...  
 L1,0 L1,1 L1,n−1  (1 − t)n−2 t 0
   

...
  
· P[t] = (18.78)
: : ::: : : : 
 
   
Ln−1,0 Ln−1,1 ... Ln−1,n−1 0
   
tn−1
   

where   
X n n
Li,j = Pl × Pm . (18.79)
l m
l+m=i+j+1

By calculating linear combinations of these rows of the n × n matrix, we can always zero out all but
two elements in the left-most column, since all such elements are lines which pass through the point
P0 :
L0,0 L0,1 L0,n−1 0 
   
...
(1 − t)
 n−1
 
 L1,0 L L 0 
 
1,1 ... 1,n−1    
(1
 n−2
 
− t) t
   
 0 L <1>
L<1>
P[t] = 0 (18.80)
 
... · .
:
2,1 2,n−1

 : : ::: : :
    
   
tn−1
   
0 L<1>
n−1,1 ... Ln−1,n−1 0
<1>  
 

L<k>
i,j denotes the element after k-th calculation. Now, we have n − 2 moving lines whose degree is
n−1 :
L2,1 L<1> L<1>
 <1>
(1 − t)n−2  0
   
2,2 ... 2,n−1   
 L<1> L <1>
L <1>
(1 0
 n−3 
  
... − t) t
  
· P[t] = (18.81)

 3,1 3,2 3,n−1
.
: : ::: : : :

    
L<1> L L 0
<1> <1>
 n−2
  
... t
   
n−1,1 n−1,2 n−1,n−1

In this (n − 2) × (n − 1) matrix, it turns out that we can again zero out all but two elements of
the left-most column, since magically, all lines L<1>i,1 contain the point P0 . This can be seen by
evaluating the set of equations (18.81) at t = 0:

 L2,1
 <1> 
0 
 
  
L<1> 0
 
 
  
3,1
· P[0] = . (18.82)
 :   : 
Ln−1,1 0

 <1>   
  

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Curve Representation with Two Moving Lines 229

This zeroing out process can be repeated until one or two rows remain.
If the degree is n = 2m, we can repeat the element zeroing process m − 1 times and obtain two
degree m moving lines
(1 − t)m 
 

Ln−2,m−1 L<m−1> ... Ln−2,n−1
 <m−1> <m−1>
(1 − t)m−1 t 0
 
 
  
n−2,m
· P[t] = . (18.83)
L<m−1>
n−1,m−1 Ln−1,m
<m−1>
... L<m−1>
n−1,n−1 
 : 
 0
tm
 

If the degree is n = 2m + 1, we can repeat the zero out process m times. In this case, only one
element can be eliminated in the last step, and thus, the bottom two rows express degree m + 1 and
degree m moving lines
(1 − t)m+1 
 

Ln−2,m−1 L<m−1> ... L<m−1> (1 − t)m t 0
 <m−1>  
 
  
n−2,m n−2,n−1
· P[t] = . (18.84)
0 L<m>
n−1,m ... L<m>
n−1,n−1 
 : 
 0
tm+1
 

If there is a triple or higher order multiple point, however, the bottom two moving lines may be
reducible. In such case, a lower degree moving line can be obtained as discussed in section 18.4.4.

18.4.6 Implicitization
Conventionally, the implicit equation of a rational Bézier curve is calculated as the determinant of
the n × n matrix in equation (18.78) [SAG84], which is called Bezout’s resultant. It is also possible
to implicitize using a pair of moving lines. An arbitrary point P = (x, y, 1) lies on the curve P[t] if
and only if it lies on both moving lines in equation (18.83) (or (18.84)):

(1 − t)m 
 

Ln−2,m−1 · P L<m−1>n−2,m · P ... Ln−2,n−1 · P
 <m−1> <m−1>
(1 − t)m−1 t 0
 
  
 
= . (18.85)
L<m−1>
n−1,m−1 · P Ln−1,m · P ... Ln−1,n−1 · P
<m−1> <m−1>

 : 
 0
tm
 

This is equivalent to saying that, if P = (x, y, 1) lies on the curve, then there exists a value of t
which satisfies both equations (18.85), which means that the resultant of the two equations is zero.
Let us calculate the implicit equation of the quartic curve in Figure 18.12. By calculating the
dot product with P for each element, equation (18.69) is expressed as follows
  (1 − t)2  
 
2y 4x + 4y − 8 4x − 2y − 8 0
 
(1 − t)t = . (18.86)
8x + 6y 28x + 4y − 24 20x − 14y − 40  0
t2

The implicit equation is the resultant of these two quadratic equations of t,


2y 4x + 4y − 8 2y 4x − 2y − 8


8x + 6y 28x + 4y − 24 8x + 6y 20x − 14y − 40


2y 4x 2y 8 4x + 4y − 8 4x 2y 8

− − − −
8x + 6y 20x − 14y − 40 28x + 4y − 24 20x − 14y − 40

−32x2 − 16y 2 + 64x −32x2 + 32xy − 16y 2 + 64x − 32y



=

−32x2 + 32xy − 16y 2 + 64x − 32y −32x2 + 64xy − 48y 2 − 64y + 128


= 512(y 4 + 4x3 + 2xy 2 − 16x2 − 6y 2 + 16x). (18.87)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
230 Tangent Moving Lines

This method is generally faster than the conventional method. In most cases, the resultant of the
two moving lines ends up in a ( n2 )×( n2 ) determinant, while you must calculate the n×n determinant
in conventional method.

18.5 Tangent Moving Lines


18.5.1 Tangent Moving Lines and Envelope Curves
Consider the moving line which is tangent to a curve P[t] at each parameter value t. We call this
the tangent moving line of P[t]. The tangent moving line is computed
Line(P[t] × P0 [t]). (18.88)
where P0 [t] = (X 0 [t], Y 0 [t], W 0 [t]). Thus, one would expect the tangent moving line to generally be
degree 2m − 1 if P[t] is a degree m curve. However, it happens that P[t] × P0 [t] always has a base
point at t = ∞. This is most easily seen by using power basis polynomials
Xm m
X m
X
P[t] = ( Xi ti , Yi ti , Wi ti ); (18.89)
i=0 i=0 i=0
m−1
X m−1
X m−1
X
P0 [t] = ( (i + 1)Xi+1 ti , (i + 1)Yi+1 ti , (i + 1)Wi+1 ti ); (18.90)
i=0 i=0 i=0

P[∞] = (Xm , Ym , Wm ); (18.91)


P [∞]
0
= m(Xm , Ym , Wm ). (18.92)
Thus, when equation (18.88) is expanded, the coefficient of t2m−1 is (Xm , Ym , Wm )×m(Xm , Ym , Wm ) =
(0, 0, 0). Therefore, the degree of the tangent moving line is at most 2m − 2.
The control lines of the tangent moving line can be obtained as follows. Both P[t] and P0 [t] can
be expressed with degree m − 1 Bernstein polynomials:
m
X m−1
X m−1
X
P[t] = Bim [t]Pi = (1 − t) Bim−1 [t]Pi + t Bim−1 [t]Pi+1 (18.93)
i=0 i=0 i=0
m−1
" m−1 m−1
#
X X X
P [t]
0
= m Bim−1 [t](Pi+1 − Pi ) = m − Bim−1 [t]Pi + Bim−1 [t]Pi+1 . (18.94)
i=0 i=0 i=0

Thus, "m−1 #
X m−1
X
P[t] × P [t] = m
0
Bim−1 [t]Pi × Bim−1 [t]Pi+1 . (18.95)
i=0 i=0
Any non-axial moving line L[t] can be represented as the set of lines which are tangent to a given
parametric curve — its envelope curve. The envelope curve is given by the equation
Point(L[t] × L0 [t]) (18.96)
where L0 [t] = (a0 [t], b0 [t], c0 [t]) [Win23], p. 244. Thus, L[τ ] contains Point(L[τ ] × L0 [τ ]) and is
tangent to its envelope curve at that point. Figure 18.14 shows an example of a cubic moving line
and its envelope curve. Notice that equations (18.88) and (18.96) are the dual of each other. The
degree of L[t] × L0 [t] is at most 2m − 2 if L[t] is a degree m moving line. The control points can be
calculated using the dual of equation (18.95).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Tangent Moving Lines 231

L2
L1

L0 L3

Figure 18.14: Envelope curve

18.5.2 Reciprocal Curves


We would expect that
Point ((P[t] × P0 [t]) × (P[t] × P0 [t])0 ) = Point(P[t]). (18.97)
That is, if we compute the envelope curve of the tangent moving line of P[t], we would expect to
end up with P[t]. However, the expression on the left is degree 4m − 6 and the on the right is degree
m. Thus, we conclude that the expression on the left must have 3m − 6 base points. How do we
account for those base points?
In equation (18.88), Line(P[t]×P0 [t]) has a base point at t = τ if and only if P[τ ] = 0 or P0 [τ ] = 0.
The latter condition means that the curve P[t] has a cusp (or stationary point [Sal34], p.25) at t = τ .
Likewise, in equation (18.96), Point(L[t] × L0 [t]) has a base point at t = τ if and only if L[τ ] = 0 or
L0 [τ ] = 0. Notice that the latter condition is equivalent to saying that the envelope curve L[t] × L0 [t]
has an inflection point (or stationary tangent [Sal34], p.33) at t = τ . Now, let m be the degree of the
curve P[t], and let κ and ι be its number of cusps and inflection points respectively. Assume that the
curve has no base point. Then, the degree of its tangent moving line, Line(P[t]×P0 [t]), is 2m−2−κ,
and the degree of the envelope curve of the moving line, Point((P[t] × P0 [t]) × (P[t] × P0 [t])0 ) (i.e.
the original curve P[t]), is 4m − 6 − 2κ − ι. This fact concludes that any rational curve of degree m
must have the following number of cusps and/or inflection points
2κ + ι = 3m − 6. (18.98)
Equation (18.98) is confirmed by one of Plücker’s six equations [Sal34], p.65 for implicit curves
ι = 3m2 − 6m − 6δ − 8κ (18.99)
where δ is the number of double points except cusps. For any rational curve of degree m, there are
fixed number of double points (include cusps)
1
δ+κ= (m − 1)(m − 2). (18.100)
2

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
232 Tangent Moving Lines

Line(B(!))

Line(A(!)) Point(A(!))

(0,0)

Point(B(!))

Figure 18.15: Dual and Reciprocal

By eliminating δ from equations (18.99) and (18.100), we can obtain equation (18.98).
Given A[t], Point(A[τ ]) is the dual of Line(A[τ ]) for every value of τ , as defined in Figure 18.2.
Thus, we say that the moving point Point(A[t]) is dual with the moving line Line(A[t]). Consider
a second moving point Point(B[t]) and its dual moving line Line(B[t]). If

B[t] = k1 [t](A[t] × A0 [t]) (18.101)

where k1 [t] is a rational function, then there also exists a rational function k2 [t] such that

A[t] = k2 [t](B[t] × B0 [t]). (18.102)

When this relationship exists, Point(A[t]) and Point(B[t]) are referred to as reciprocal curves [Sal34],
p.54. The rational functions are related
1
k2 [t] =
k12 [t]A[t] × A0 [t] · A00 [t]
1
k1 [t] = (18.103)
k2 [t]B[t] × B0 [t] · B00 [t]
2

The geometric relationship between two reciprocal curves is shown in Figure 18.15. For any
value of t = τ , Point(A[τ ]) has a dual Line(A[τ ]) which is tangent to the curve Point(B[t]) at
Point(B[τ ]). Likewise, Point(B[τ ]) has a dual Line(B[τ ]) which is tangent to the curve Point(A[t])
at Point(A[τ ]). If Point(A[τ ]) happens to be a cusp, then Point(B[τ ]) is an inflection point, and vice
versa (see Figure 18.16). If Point(A[τ ]) = Point(A[β]) (that is, if there exists a self intersection or
crunode), then Point(B[τ ]) and Point(B[β]) have the same tangent line (known as a double tangent).
This is illustrated in Figure 18.17.
Table 18.1 summarizes the correspondences between a pair of reciprocal curves. The degree of a
curve can be defined as the number of times (properly counting real, complex, infinite, and tangent

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Tangent Moving Lines 233

Line(A(!))

(0,0)
Point(B(!))
Point(A(!))

Line(B(!))

Figure 18.16: Cusp ⇔ Inflection Point

Line(B("))

Point(A(!))=Point(A("))

(0,0)
Point(B(!))

Line(A(!))=Line(A("))

Point(B("))
Line(B(!))

Figure 18.17: Crunode ⇔ Double Tangent

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
234 Tangent Moving Lines

Table 18.1: Reciprocal Curve

curve 1 curve 2
degree class
class degree
double point double tangent
double tangent double point
cusp inflection point
inflection point cusp

intersections) any line intersects the curve. The class of a curve is the number of lines passing
through a given point which are tangent to the curve.
Tangent moving lines and reciprocal curves provide a powerful tool for analyzing the singularities
of rational curves. For example, you can obtain the inflection points of a curve by finding the cusps
of its reciprocal curve. The lines tangent to a curve at two distinct real points are found as the
crunodes of the reciprocal curve. Equation (18.95) provides an easy way to compute reciprocal
curves in Bernstein form.

18.5.3 Tangent Directions


The hodograph P0 [t] of a curve P[t] is its parametric first derivative. The vector with tail at the origin
and tip at P0 [t] indicates the magnitude and direction of the derivative of P[t]. It is well-known that
the hodograph of a degree n polynomial Bézier curve can be expressed as a degree n − 1 polynomial
Bézier curve. However the hodograph of a degree n rational curve is much more complicated, being a
rational function of degree 2n. [SW87] proposed a scaled hodograph, which shows only the derivative
direction, and is a degree 2n − 2 polynomial Bźier curve. We can derive an equivalent result using
tangent moving lines.
Let LT [t] be the tangent moving line of a degree n curve P[t], and let

LT i = Line(ai , bi , ci ) (i = 0, 1, . . . , 2n − 2) (18.104)

be its control lines. If we force all ci to be 0


2n−2
X
LH [t] = LHi (18.105)
i=0
LHi = Line(ai , bi , 0), (18.106)

then this moving line LH [t] has an axis at the origin. Notice that LH [t] follows the degree 2n − 2
polynomial curve
2n−2
X
PH [t] = PHi (18.107)
i=0
PHi = Point(bi , −ai , 1), (18.108)

because
Point(0, 0, 1) × Point(bi , −ai , 1) = Line(ai , bi , 0). (18.109)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Tangent Moving Lines 235

Since two moving lines LT [t] and LH [t] has the same direction at any t, LH [t] gives the tangent
direction of the curve P[t]. Thus, the curve PH [t] is a scaled hodograph of P[t].
This method is available for any rational curve P[t], however, the magnitude of the derivative is
not correct except for polynomial curves.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
236 Tangent Moving Lines

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 19

Genus and Parametrization of


Planar Algebraic Curves

19.1 Genus and Parametrization


We have seen that every parametric curve can be expressed in implicit form. The reverse is not
generally true. The condition under which an implicit curve can be parametrized using rational
polynomials is that its genus must be zero. Basically, the genus of a curve is given by the formula
g = (n−1)(n−2)
2 − d where g is the genus, n is the degree, and d is the number of double points. There
are some subtleties involved in this equation, but we will not concern ourselves with them. They
deal with more complicated multiple points.
We see immediately that all curves of degree one and two have genus zero and thus can be
parametrized using rational polynomials. Curves of degree three must have one double point in
order to qualify.
It is also the case that an irreducible curve of degree n can have at most (n − 1)(n − 2)/2 double
points. Thus, a rational degree n curve has the largest possible number of double points for a curve
of its degree. An irreducible curve is one whose implicit equation f (x, y) = 0 cannot be factored.
For example, the degree two curve xy + x + y + 1 can be factored into (x + 1)(y + 1) and is thus
actually two straight lines. Note that the point at which those two lines intersect is a double point
of the curve, even though an irreducible conic cannot have any double points.
Another example of a reducible curve is given by the quartic which is factored into

(x2 + y 2 − 1)(x2 + y 2 − 4)

which is two concentric circles. This leads to another characteristic of rational curves - you can
sketch an entire rational curve without removing your pencil from the paper (with the possible
exception of a finite number of acnodes). For this reason, the classical algebraic geometry literature
sometimes refers to rational curves as “unicursal” curves.
It should also be noted that an algebraic curve which consists of more than one component is not
necessarily reducible. For example, many non-rational cubic curves consist of an oval and a branch
which does not touch the oval, and yet the equation does not factor.

237
238 Detecting Double Points

Figure 19.1: Irreducible Cubic Curve

19.2 Detecting Double Points


How does one verify the existence of a double point? A computational method is to verify that
any straight line through the alleged double point hits the curve at least twice at that point. For
example, any curve whose equation has no constant or linear terms has a double point at the origin.
Consider the cubic algebraic curve:

x3 − 2xy 2 + xy + 3y 2 = 0.

To determine how many times a general line through the origin hits this curve, we define such a line
parametrically so that the point t = 0 on the line corresponds to the origin:

x = at, y = bt.

The intersection of the line and the curve yields

(a3 − 2ab2 )t3 + (ab + 3b2 )t2 = 0.

Since this equation has at least a double root at t = 0 for any values of a and b (which control the
slope of the line), we conclude that the curve has a double point at the origin.
There are basically three types of double points: the crunode (or simply node, or self intersection),
the cusp, and the acnode (or isolated node). An example of a cubic curve with a crunode at the
origin is the curve in Figure 19.2 whose implicit equation is

x3 + 9x2 − 12y 2 = 0.

You can verify by implicitization that this curve can be expressed as a Bézier curve with control
points (3, 3), (−13, −15), (−13, 15), (3, −3).
An example of a cubic curve with a cusp at the origin is given by

x3 − 3y 2 = 0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Detecting Double Points 239

Figure 19.2: Crunode: x3 + 9x2 − 12y 2 = 0

Figure 19.3: Cusp: x3 − 3y 2 = 0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
240 Implicit Curve Intersections

Figure 19.4: Acnode: x3 − 3x2 − 3y 2 = 0

which is illustrated in Figure 19.2.


An example of a curve with an acnode at the origin is shown in Figure 19.2, given by the equation

x3 − 3x2 − 3y 2 = 0.

We can classify a double point as being a crunode, acnode or cusp by examining the tangent
lines to the curve at the double point. A crunode has two distinct real tangent lines, a cusp has
two identical tangent lines, and an acnode has two complex tangent lines. A tangent line through a
double point hits the curve three times at the double point. We can find the slope of the tangent
lines by computing values of a and b for which the intersection of the line and the curve has a triple
root at t = 0. In the previous example, this occurs if ab + 3b2 = 0 from which a = 1, b = 0 and
a = −3, b = 1 are the two independent solutions. These represent two real, distinct lines, so the
double point in a crunode.
The exercise that we just performed only lets us verify that a given point is singular (a singular
point is a double point, triple point, or multiple point in general). To determine the location of
singular points, we can use a tool known as the discriminant (discussed later).

19.3 Implicit Curve Intersections


We have seen how the intersections of two Bezier curves can be computed, and also how the in-
tersection points of a parametric and an implicit curve can be found. What about two implicit
curves?
One direct method for computing the intersection points of two implicit curves is to take the
resultant of the curves with respect to x or y. The X-resultant is computed by treating the implicit
equations as polynomials in x whose coefficients are polynomials in y. The X-resultant eliminates
x from the two equations and produces a polynomial in y whose roots are the y coordinates of the
intersection points.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Discriminants 241

(5/3, 4/3)
(-5/4, 3/4)
13/12, 5/12)
(1, 0)

Figure 19.5: Circle and Hyperbola

We illustrate with a circle 6x2 + 6y 2 − 2x − 15y − 4 = 0 and a hyperbola x2 − y 2 − 1 = 0.

The x-resultant of these two implicit equations is 144y 4 − 360y 3 + 269y 2 − 60y whose roots
are y = 0, y = 4/3, y = 3/4, and y = 5/12. These are the y-coordinates of the points of intersection
of the two curves.
We can use the y-resultant to find the x-coordinates of the points of intersection. The y-resultant
is 144x4 − 48x3 − 461x2 + 40x + 325 which has roots x = 1, x = 5/3, x = −5/4, and x = −13/12.
We now find ourselves in the interesting situation of knowing the x and y components of the
points of intersection, but we don’t know which x goes with which y! One way to determine that is
simply to evaluate each curve equation with every x and every y to see which (x, y) pairs satisfy both
curve equations simultaneously. A more clever way is to use Euclid’s algorithm. In fact, Euclid’s
algorithm spares us the trouble of computing both the x-resultant and the y-resultant.
Suppose we had only computed the y-resultant and we wanted to find the y-coordinate of the
point of intersection whose x-coordinate is 5/3. That is to say, we want to find a point ( 35 , y) which
satisfies both curve equations. We substitute x = 5/3 into the circle equation to get 16/6 − y 2 = 0
and into the hyperbola equation to get 6y 2 − 15y + 28/3 = 0. We now simply want to find a
value of y which satisfies both of these equations. Euclid’s algorithm tells us that the GCD of these
two 3y − 4 = 0, and thus one point of intersection is ( 35 , 43 ).

19.4 Discriminants
The discriminant of a univariate polynomial is the resultant of the polynomial and its first deriva-
tive. If the discriminant is zero, the polynomial has a double root. (Why?) We all encountered
discriminants as early as 7th grade in connection with the quadratic equation. For a degree two
polynomial at2 + bt + c, the value b2 −4ac is referred to as the discriminant, although if we actually
compute the resultant of at2 + bt + c and its derivative 2at + b, we find that the discriminant is
actually a2 (b2 − 4ac). However, since it is understood that a 6= 0, the discriminant can only vanish
if b2 − 4ac = 0.
It is also possible to compute the discriminant of an implicit curve by taking the resultant of

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
242 Parametrizing Unicursal Curves

the implicit equation and its partial derivative with respect to one of the variables. To do this, we
treat the implicit equation as a polynomial in y whose coefficients are polynomials in x (or, vice
versa). The resultant will then be a polynomial in x with constant coefficients. The roots of that
polynomial will correspond to the x coordinates of the vertical tangents and of any double points.
Graphically, the discriminant can be thought of as the silhouette of the curve.

19.5 Parametrizing Unicursal Curves


There are several ways in which a parametrization may be imposed on a curve of genus zero. For
a conic, we may establish a one-one correspondence between points on the curve and a family of
lines through a point on the curve. This is most easily illustrated by translating the curve so that
it passes through the origin, such as does the curve

x2 − 2x + y 2 = 0

which is a unit circle centered at (0, 1). We next make the substitution y = tx and solve for x as a
function of t:
x2 (1 + t2 ) − 2x = 0
2
x =
1 + t2
2t
y = tx =
1 + t2
Notice that y = tx is a family of lines through the origin. A one parameter family of lines (or,
of any implicitly defined curves) is known as a pencil of lines or curves. The variable line y = tx
intersects the curve once at the origin, and at exactly one other point (because of Bezout’s theorem).
Thus, we have established a one-one correspondence between points on the curve and values t which
correspond to lines containing that point and the origin.
An example of a circle parametrized in this manner is shown in Figure 19.6.
The same trick can be played with a genus zero cubic curve which has been translated so that
its double point lies on the origin. if this happens, its implicit equation involves terms of degree two
and three only. For example, consider the curve

(x3 + 2x2 y + 3xy 2 + 4y 3 ) + (5x2 + 6xy + 7y 2 ) = 0

which has a double point at the origin. Again make the substitution y = tx to obtain

x3 (1 + 2t + 3t2 + 4t3 ) + x2 (5 + 6t + 7t2 ) = 0.

From which
5 + 6t + 7t2 5t + 6t2 + 7t3
x = − , y = tx = −
1 + 2t + 3t2 + 4t3 1 + 2t + 3t2 + 4t3
An example of a cubic curve parametrized in this manner is shown in Figure 19.7.
In general, a cubic curve does not have a double point, and if it does, that double point is not
generally at the origin. Thus, before one can parametrize a cubic curve, one must first compute the
location of its double point (or, determine that rational parametrization is not possible if there is
no double point).

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Parametrizing Unicursal Curves 243

t = y/x = 1

(1,1)
t = y/x
(1.8,.6)
t = y/
(0,0) (2,0)
(1.6,-.8)
t = y/x =-

Figure 19.6: Parametrizing a Circle

Y t = y/x =
(6,6)
1 t=y
-1.2 (9,4.5

-1
1.5 t
(9,0)

1.7

Figure 19.7: Parametrizing a Cubic Curve

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
244 Undetermined Coefficients

Double points satisfy the equations f (x, y) = fx (x, y) = fy (x, y) = 0. Consider the cubic curve

f (x, y) = −21 + 46 x − 13 x2 + x3 + 25 y − 23 x y + 3 x2 y − 9 y 2 + 3 x y 2 + y 3

for which
fx (x, y) = 46 − 26 x + 3 x2 − 23 y + 6 x y + 3 y 2
and
fy (x, y) = 25 − 23 x + 3 x2 − 18 y + 6 x y + 3 y 2
From section 19.3, we compute the x coordinates of the intersections of fx = 0 and fy = 0 by taking
the resultant of fx and fy with respect to y:

Resultant(fx , fy , y) = 174 − 159 x + 36 x2

whose roots are x = 2 and x = 12 29


. Likewise the y coordinates of the intersections of fx = 0 and
fy = 0 are found by taking the resultant of fx and fy with respect to x:

Resultant(fx , fy , x) = 297 − 207 y + 36 y2

whose roots are y = 3 and y = 11 4 . From these clues, we find that the only values of (x, y) which
satisfy f (x, y) = fx (x, y) = fy (x, y) = 0 are (x, y) = (2, 3), which is therefore the double point.
This curve can be parametrized by translating the implicit curve so that the double point lies at
the origin. This is done by making the substitution x = x + 2, y = y + 3, yielding

2 x2 + x3 + 7 x y + 3 x2 y + 6 y 2 + 3 x y 2 + y 3

Parametrization is then performed using the method discussed earlier in this section,

6t2 + 7t + 2 6t3 + 7t2 + 2t


x=− ; y = −
t3 + 3t2 + 3t + 1 t3 + 3t2 + 3t + 1

and the parametrized curve is translated back so that the doubled point is again at (2, 3):

6t2 + 7t + 2 2t3 − t
x=− + 2 = ;
t3 + 3t2 + 3t + 1 t3 + 3t2 + 3t + 1

6t3 + 7t2 + 2t −3t3 + 2t2 + 7t + 3


y=− +3= 3
t3+ 3t + 3t + 1
2 t + 3t2 + 3t + 1

19.6 Undetermined Coefficients


An implicit curve equation has (n + 1)(n + 2)/2 terms. Since the equation f (x, y) = 0 can be scaled
without changing the curve, we can freely assign any of the non-zero coefficients to be 1 (or, any
other value that we choose) and we are left with (n2 + 3n)/2 coefficients. This means that we can
generally specify (n2 + 3n)/2 points through which an implicit curve will pass. One way this is
done is by using the method of undetermined coefficients.
Consider the general conic given by

c20 x2 + c11 xy + c02 y 2 + c10 x + c01 y + c00 = 0

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Undetermined Coefficients 245

and five points (xi , yi ) which we wish the curve to interpolate. The coefficients cij can be solved
from the system of linear equations:
 
x1 x1 y1 y1 x1 y1 1 
 2 2
  20 

 c11
 
 x22 x2 y2 y22 x2 y2 1  


 
c02
 
 x3 x3 y3 y32 x3 y3 1  = 0.
 2 
 x4 x4 y4 y42 x4 y4 1  
 2   c10 

c01
 
x25 x5 y5 y52 x5 y5 1 

 


c00
 

Of course, this method can be applied to any special equation. For example, the general equation
of a circle is (x − a)2 + (y − b)2 − r2 = 0. A circle through three points can be found by applying
the method of undetermined coefficients to the equation√Ax + By + C = x2 + y 2 to compute
A, B, C. Then, we find a = A/2, b = B/2, and r = C + a2 + b2 .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
246 Undetermined Coefficients

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Chapter 20

POLYNOMIAL
APPROXIMATION OF
RATIONAL CURVES

A degree r plane rational Bézier curve


Pr
i=0 Bi (t)wi Ri
r
R(t) = r
i=0 Bi (t)wi
r
P

= (xR (t), yR (t)) (Ri = (Xi , Yi )) (20.1)

can be expressed as a degree n plane polynomial Bézier curve H(t) with a moving control point
M(t):

H(t) ≡ R(t)
Xn
= Bin (t)Pi + M(t)Bm
n
(t)
i=0,i6=m
= (xH (t), yH (t)) (0 < m < n), (20.2)

where
Pr
i=0 Bi (t)wi Mi
r
M(t) = r (20.3)
i=0 Bi (t)wi
r
P

is a degree r plane rational Bézier curve. The curve H(t) is called a Hybrid Curve [SK91]. Fig-
ure 20.1.a shows a rational cubic curve, and Figure 20.1.b shows that same curve represented as a
degree two hybrid curve. Figure 20.1.c shows how to evaluate a point H(t) on a hybrid curve — you
first evaluate the moving control point at M(t). The polynomial Bézier curve can then be evaluated,
treating point M(t) as a stationary control point (P1 in this case). Figure 20.1.d shows the curve
in Figure 20.1.a represented as a degree four hybrid curve.
As derived in [SK91], the Pi and Mi can be computed:

247
248

V11,1
V21,1 1,1
V (t) = H11,1
R1
R2
V01,1 V31,1

R0 R3 H21,1 H21,1
H01,1 H01,1
a) Degree 3 Rational Curve b) Quadratic Hybrid Curve c) Quadratic Hybrid Curve

V12,2 V22,2
V32,2 V13,3 V23,3
V02,2 4,4
V (t)
V03,3 V3,3
3
H43,3 H34,4 H54,4
H12,2 H32,2 H23,3
H24,4 H64,4
H13,3 H53,3 H74,4
H14,4
H42,2 H63,3 H84,4
H02,2 H03,3 H04,4
d) Quartic Hybrid Curve e) Degree 6 Hybrid Curve f) Degree 8 Hybrid Curve

Figure 20.1: Hybrid curves

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
249

For i = 0, . . . , m − 1:

P0 = R0 ,
Pmin(r,i) r n
wj [Rj − Pi−j ]
 
j=1 j i−j
Pi = R0 + . (20.4)
w0 ni


For i = n + r, . . . , m + 1 + r:

Pn = Rr ,
Pr−1
i−j wj [Rj − Pi−j ]
r n
 
j=max(0,i−n) j
Pi−r = Rr + n
 . (20.5)
wr i−r

For i = 0, . . . , r:
min(i+m,r) r n
wj [Rj − Pi+m−j ]
 
j i+m−j
X
Mi = n r
  + Ri . (20.6)
wi m i
j = max(0, i + m − n)
j 6= i

The moving control point is always a rational curve of the same degree as the original rational
curve. Also, the control point weights of the moving control point curve is the same as those of the
original rational curve.

a) One hybrid curve. b) Two hybrid curves.

Figure 20.2: Hybrid curves after subdivision

If we simply replace the moving control point M(t) with a stationary control point Pm , the
hybrid representation H(t) of the rational curve R(t) leads directly to a polynomial approximation
P(t) (as in equation 20.10). An intelligent choice of point Pm is the midpoint of the x/y min-max

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
250 PLANAR AREAS

box which bounds the moving control point. Denote the width of such a bounding box as 2|4x |, the
heighth 2|4y |, and the diagonal 2||4||. If n is an even number, m = n/2, and ||M(t) − Pm || ≤ ||4||,
then
1
 
n
||P(t) − H(t)|| ≤ ||4|| n , (20.7)
2 2n

|xP (t) − xH (t)| ≤ BxP H


1
 
n
= |4x | n , (20.8)
2 2n

|yP (t) − yH (t)| ≤ ByP H


1
 
n
= |4y | n . (20.9)
2 2n
Note that ||4|| for the quartic hybrid curve is smaller than ||4|| for the quadratic hybrid curve.
This is often, though not always, the case, depending on the radius of convergence. Conditions
under which convergence does occur is discussed in [WS93]. However, as illustrated in Figure 20.2,
each half of a subdivided rational curve always has a smaller value of ||4|| than does the original
rational curve.

20.1 PLANAR AREAS


Shape design often calls for the computation of integral values such as the cross-sectional area of
ducts or the center of gravity of a ship’s cross-section. For plane regions bounded by polynomial
Bézier curves, closed form solutions exist. This chapter reviews those solutions and also presents
a numerical algorithm for the case of where the bounding curves are in rational Bézier form. The
earliest such algorithm for polynomial curves is probably due to Faux and Pratt [FP79]. General
algorithms have been developed by Liu, Nowacki, and Lu [Liu87, NLL90].
Most algorithms for polynomial curves, such as evaluation, subdivision and degree elevation,
extend readily to rational curves, while other algorithms, such as those involving derivatives and
integrals, do not. Ultimately, the problem of computing areas, centroids, or volumes of revolution for
regions bounded by rational Bézier curves reduces to the problem of integrating a rational function
(that is, a polynomial divided by another polynomial) for which there exist basically two approaches:
the method of partial fractions, and numerical integration.
Recall that partial fractions is a basic technique from calculus in which a rational function of t
is written as the sum of a polynomial and fractions of the form
A At + B
or ,
(at + b)k (at + bt + c)k
2

where A, B, a, b and c are constants and k is a positive integer. This method leads to straightforward
closed-form integration formulae for degree two rational functions, and significantly more compli-
cated formulae for degree three and four cases. Closed-form integration formulae do not generally
exist for degree greater than four.
Numerical integration [BF89], using methods such as the trapezoid rule, Simpson’s rule, etc., is
the technique most often applied in practice. But for rational functions, determining an error bound
is expensive, since it involves finding a bound on high order derivatives of a rational function.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Integrals Involving Plane Bézier Curves 251

20.2 Integrals Involving Plane Bézier Curves


This section reviews general algorithms for computing integral values on plane Bézier curves, as
given by D. Liu and H. Nowacki [Liu87, NLL90].
Let Pi = (xi , yi ) ∈ R2 , i = 0, 1, . . . , n, then
n
X
P(t) = Bin (t)Pi
i=0
= (xP (t), yP (t)) (Pi = (xi , yi )) (20.10)

is a degree n plane Bézier curve.


First, define the following:
Z 1
(n)
Ci,j = Bin (t)Bjn−1 (t)dt,
0
(n) (n) (n)
Di,j = Ci,j−1 − Ci,j
− 2n 1
(i, j) = (0, 0)






1
(i, j) = (n, n)


2n




= 0
n
10
n
1
(20.11)
(j−i)@

 A@ A
 i j
0 ≤ i, j ≤ n, (i, j) 6= (0, 0), (n, n).



2n A
 0 1


 (i+j)(2n−i−j)@

i+j
Z 1
(n)
Ci,j,k = Bin (t)Bjn (t)Bkn−1 (t)dt,
0
(n) (n) (n)
Di,j,k = Ci,j,k−1 − Ci,j,k
1
− 3n (i, j, k) = (0, 0, 0)






1
(i, j, k) = (n, n, n)


3n




= 0
n
10
n
10
n
1
(20.12)
(2k−i−j)@

 A@ A@ A
 i j k
0 ≤ i, j, k ≤ n, (i, j, k) 6= (0, 0, 0), (n, n, n).



3n
 0 1


 (i+j+k)(3n−i−j−k)@
i+j+k
 A

The area under a curve given by equation 20.10 over the interval [x0 , xn ] (see Figure 20.3) is:
Z xn
Area = yP dxP
x0
n
X (n) dxP (t)
= n Di,j yi xj , ( 6= 0, 0 ≤ t ≤ 1). (20.13)
i,j=0
dt

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
252 Integrals Involving Plane Bézier Curves

P2
y
P1

P0
R
P3

x0 xn

Figure 20.3: Area under cubic Bézier curve

P2
y
P1

P0

P3

Figure 20.4: Area of cubic Bézier sector

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Error Bounds on Integration 253

The area contained in the sector formed by the origin and a curve given by equation 20.10 (see
Figure 20.4) is:

1 1
Z
dP(t)
Directed Area = P(t) ∧ dt
2 0 dt
n
X (n) dP(t)
= n Di,j (Pi ∧ Pj ), (P(t) ∧ 6= 0, 0 ≤ t ≤ 1),(20.14)
dt
i, j = 0
i<j

where symbol ∧ denotes a wedge product, and



x yi
Pi ∧ Pj = i . (20.15)
xj yj

The first moments of area of R (in Figure 20.3) about the x- and y-axes are:

1 2
xn
Z
Ix = yP dxP
x0 2
n
n X (n)
= Di,j,k yi yj xk . (20.16)
2
i,j,k=0
Z xn
Iy = xP yP dxP
x0
n
(n)
X
= n Di,j,k xi yj xk . (20.17)
i,j,k=0

The volume of a solid of revolution generated by revolution of region R (in Figure 20.3) about the
x-axis is:
Z xn
V olume = πyP2 dxP
x0
= 2πIx . (20.18)

20.3 Error Bounds on Integration


Computing areas, etc., of rational Bézier curves can be done by first approximating the rational curve
with a polynomial curve (as discussed in chapter 20), then applying the closed form equations for
polynomial curves. This section discusses how to determine error bounds on the resulting integration
values.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
254 Error Bounds on Integration

From [Flo92], bounds for P0 (t), R0 (t), P(t), and R(t) are

|x0P (t)| ≤ Bx0 P


= n · max0≤i≤n−1 |4xi |, (20.19)
|yP0 (t)| ≤ B y0 P
= n · max0≤i≤n−1 |4yi |, (20.20)
|x0R (t)| ≤ Bx0 R
 2
max0≤i≤r wi
= r· · max0≤i≤r−1 |4Xi |, (20.21)
min0≤i≤r wi
0
|yR (t)| ≤ By 0 R
 2
max0≤i≤r wi
= r· · max0≤i≤r−1 |4Yi |, (20.22)
min0≤i≤r wi
|xP (t)| ≤ BxP
= max0≤i≤n |xi |, (20.23)
|yP (t)| ≤ ByP
= max0≤i≤n |yi |, (20.24)
|xR (t)| ≤ BxR
= max0≤i≤r |Xi |, (20.25)
|yR (t)| ≤ ByR
= max0≤i≤r |Yi |. (20.26)

R
x Rx
Of special interest is the error bound x0n yR dxR − x0n yP dxP which expresses the error in applying

integration formulae directly to polynomial approximations of rational curves:

Z xn Z xn Z 1 Z 1
yR dxR − yP dxP = yR x0R dt − yP x0P dt
x0 x0 0 0
Z 1 Z 1
= yH x0H dt − yP x0P dt
0 0
Z 1
= (yH x0H − yH x0P + yH x0P − yP x0P )dt
0
Z 1 Z 1
= yH d(xH − xP ) + (yH − yP )x0P dt
0 0
Z 1 Z 1
= − (xH − xP )yH
0
dt + (yH − yP )x0P dt,
0 0

and hence
Z xn Z xn Z 1 Z 1
0
|dt + |yH − yP | · |x0P |dt


yR dxR − yP dxP ≤ |xH − xP | · |yH
x0 x0 0 0
≤ BxP H · By0 R + ByP H · Bx0 P . (20.27)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Error Bounds on Integration 255

Likewise,

Z 1 Z 1 Z 1 Z 1
dR dP dH dP
R∧ P∧ = H∧ P∧

dt − dt dt − dt

0 dt 0 dt
0 dt 0 dt
Z 1   Z 1 
dH dP dP
= H ( ) + (H P)

∧ − dt − ∧ dt

0 dt dt 0 dt
Z 1 Z 1
0 xH 0 yH xH − xP yH − yP
= dt +

0
− yP0 x0P yP0 dt

x −x yH
0 H P 0
Z 1 Z 1 Z 1
= xH (yH 0
− yP0 )dt − yH (x0H − x0P )dt + (xH − xP )yP0 dt



0 0 0
Z 1
(yH − yP )x0P dt


0
Z 1 Z 1 Z 1
= (y )x 0
+ (x )y 0
+ (xH − xP )yP0 dt

− H − yP H dt H − x P H dt

0 0 0
Z 1
(yH − yP )x0P dt


0
Z 1 Z 1
= (xH − xP )(yH 0
+ yP )dt −
0
(yH − yP )(xH + xP )dt
0 0


0 0
Z 1 Z 1
≤ 0
|xH − xP |(|yH | + |yP0 |)dt + |yH − yP |(|x0H | + |x0P |)dt
0 0
≤ BxP H · (By0 R + By0 P ) + ByP H · (Bx0 R + Bx0 P ). (20.28)

Z xn Z xn Z 1 Z 1
2
yP2 dxP = 2 0 2 0


yR dxR −
y x
H H dt − y x
P P dt
x0 x0 0 0
Z 1 Z 1
= yH (xH − xP )dt +
2 0 0
yH (yH − yP )x0P dt+



0 0
Z 1
yP (yH − yP )xP dt
0

0
Z 1 Z 1
= (xH − xP )yH yH dt +
0
(yH − yP )(yH + yP )xP dt
0

−2

0 0
Z 1 Z 1
≤ 2 0
|xH − xP ||yH ||yH |dt + |yH − yP |(|yH | + |yP |)|x0P |dt
0 0
≤ 2(BxP H · By0 R · ByR ) + ByP H · Bx0 P · (ByR + ByP ). (20.29)

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
256 Examples

Z xn Z xn Z 1 Z 1
= xH yH x0H dt − xP yP x0P dt


xR yR dxR − xP yP dxP
x0 x0 0 0
Z 1 Z 1
= xH yH (xH − xP )dt +
0 0
xH (yH − yP )x0P dt+


0 0
Z 1
(xH − xP )yP xP dt
0

0
Z 1 Z 1
= − (xH − xP )(x0H yH + xH yH 0
)dt + (yH − yP )xH x0P dt+

0 0
Z 1
(xH − xP )yP x0P dt

0
Z 1
= (xH − xP )(−x0H yH − xH yH 0
+ x0P yP )dt+

0
Z 1
(yH − yP )xH xP dt
0

0
Z 1
≤ |xH − xP |(|x0H ||yH | + |xH ||yH
0
| + |x0P ||yP |)dt +
0
Z 1
|yH − yP ||xH ||x0P |dt
0
≤ BxP H · (Bx0 R · ByR + By0 R · BxR + Bx0 P · ByP ) +
ByP H · Bx0 P · BxR . (20.30)

20.4 Examples
Since the integration error is a function of the hybrid curve bounding box size, that error can be
controlled by recursively splitting R(t) in half until the bounding boxes are small enough to satisfy
the ultimate integration error limit. Then, the exact integration formulae for polynomial curves can
be used.
We have implemented this algorithm and compared it against two standard methods of numerical
integration: the trapezoid rule, and Simpson’s rule. It turns out that the trapezoid rule can be
easily modified to return an error bound when dealing with rational Bézier curves. Imagine we are
computing the area between the x axis and a rational Bézier curve. Then the top of each trapezoid
is a line segment which approximates a segment of the rational Bézier curve. The convex hull of the
control points of that curve segment then serves as a bound on how accurately a given trapezoid
approximates the differential area.
The traditional way to determine an error bound for Simpson’s rule requires us to obtain a
bound on the fourth derivative of the integrand x0 (t)y(t) (for areas) or πx0 (t)y 2 (t) (for volumes).
This is possible, but for a degree r rational Bézier curve, the fourth derivative of the area (volume)
integrand is a rational function of degree 48r (64r). Instead of using this robust error bound in our
implementation of Simpson’s rule, we used the heuristic of comparing the answer obtained using
m intervals with the answer obtained using 2m intervals. This, of course, provides only a general
indication of the error, not a guarantee of precision.
Figures 20.5 and 20.6 show two test cases in which the shaded area and volume of revolution
about the x axis were computed. Figure 20.6 is actually a semi-circle expressed as a cubic rational

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Examples 257

Y P1 = (6,10) P3
w1 = 2

P2 = (13,7)
P0 = (2,5) w2 = 3
w0 = 1

Figure 20.5: Example 1

Table 20.1: Execution times for Figure 5 (10−3 seconds)


Method Tolerance = 10−3 Tolerance = 10−6
Area Volume Area Volume
Degree 8 Hybrid 1 6 4 12
Degree 6 Hybrid 2 5 5 14
Simpson 4 15 7 61
Trapezoid 6 210 40 1560

Bézier curve.
Tables 20.4 and 20.4 list the execution time in milliseconds. Tests were run on a workstation
rated at 65 Specmarks. The exact area of the semi-circle is π/8 = .39269908 . . ., and the computed
area using hybrid curves is 0.39269906 using a tolerance of 10−6 , and 0.39272477 using a tolerance
of 10−3 .

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
258 Examples

P1 = (0,1) P2 = (1,1)
w1 = 1 w2 = 1

P0 = (0,0) P3 = (1,0)
w0 = 3 w3 = 3
Figure 20.6: Example 2

Table 20.2: Execution times for Figure 6 (10−3 seconds)


Method Tolerance = 10−3 Tolerance = 10−6
Area Volume Area Volume
Degree 8 Hybrid 0.7 1.8 1.9 3.4
Degree 6 Hybrid 0.7 1.0 2.2 3.2
Simpson 0.2 0.5 1.0 1.0
Trapezoid 0.7 1.0 23 34

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
Bibliography

[AL94] W. Adams and P. Loustaunau. An introduction to Gröbner bases. American Mathematical


Society, Providence, R.I., 1994.
[B7́4] Pierre Bézier. Mathematical and practical possibilities of unisurf. In Robert E. Barnhill
and Richard F. Riesenfeld, editors, Computer Aided Geometric Design, pages 317–326.
Academic Press, 1974.
[B7́8] Pierre Bézier. General distortion of an ensemble of biparametric surfaces. Computer-Aided
Design, 10:116–120, 1978.
[B8̈1] Wolfgang Böhm. Generating the Bézier points of B-spline curves and surfaces. Computer-
Aided Design, 13:355–356, 1981.
[B8́6] Pierre Bézier. The Mathematical Basis of the UNISURF CAD System. Butterworths,
London, 1986.
[Bal74] Alan A. Ball. Consurf. part 1: Introduction to the conic lofting tile. Computer-Aided
Design, 6:243–249, 1974.
[Bal81] D. H. Ballard. Strip trees: a hierarchical representation for curves. Communications of
the ACM, 24:310–321, 1981.
[BF89] R. L. Burden and J. D. Faires. Numerical Analysis. PWS-KENT Publishing Company,
Boston, 1989.
[Buc65] B. Buchberger. Ein Algorithmus zum Auffinden der Basiselemente des Restklassenringes
Nach Einem Nulldimensionalen Polynomideal. PhD thesis, Universitat Innsbruck, Aus-
tria, 1965.
[Buc85] B. Buchberger. Gröbner bases: an algorithmic method in polynomial ideal theory. In N. K.
Bose, editor, Multidimensional Systems Theory, pages 184–232. D. Reidel Publishing Co.,
Netherlands, 1985.
[BW93] T. Becker and V. Weispfenning. Gröbner Bases: A computational approach to commuta-
tive algebra. Springer-Verlag, 1993.
[CLO92] David Cox, John Little, and Donal O’Shea. Ideals, Varieties and Algorithms. Springer-
Verlag, 1992.
[CR74] Edwin Catmull and R. Rom. A class of local interpolating splines. In Robert E. Barnhill
and Richard F. Riesenfeld, editors, Computer Aided Geometric Design, pages 317–326.
Academic Press, 1974.

259
260 BIBLIOGRAPHY

[Dav63] Philip J. Davis. Interpolation and Approximation. Dover, New York, 1963.

[dB78] Carl de Boor. A Practical Guide to Splines. Springer–Verlag, New York, 1978.

[Far90] Gerald Farin. Curves and Surfaces for Computer Aided Geometric Design. Academic
Press, Boston, 1990.

[Flo92] Michael S. Floater. Derivatives of rational Bézier curves. Computer Aided Geometric
Design, 9:161–174, 1992.

[FP79] Iver D. Faux and Michael J. Pratt. Computational Geometry for Design and Manufacture.
Ellis Horwood, Chichester, 1979.

[FR87] Rida T. Farouki and V. T. Rajan. On the numerical condition of polynomials in Bernstein
form. Computer Aided Geometric Design, 4:191–216, 1987.

[FR88] Rida T. Farouki and V. T. Rajan. Algorithms for polynomials in Bernstein form. Com-
puter Aided Geometric Design, 5:1–26, 1988.

[GSA84] Ronald N. Goldman, Thomas W. Sederberg, and David C. Anderson. Vector elimina-
tion: A technique for the implicitization, inversion, and intersection of planar parametric
rational polynomial curves. Computer Aided Geometric Design, 1:327–356, 1984.

[GZ84] Wang Guo-Zhao. The subdivision method for finding the intersection between two Bézier
curves or surfaces. Zhejiang University Journal special issue on computational geometry,
pages 108–119, 1984.

[Han78a] E. Hansen. A globally convergent interval method for computing and bounding real roots.
BIT, 18:415–424, 1978.

[Han78b] E. Hansen. Interval forms of Newton’s method. Computing, 20:153–163, 1978.

[HL93] J Hoschek and D Lasser. Fundamentals of Computer Aided Geometric Design. A K


Peters, 1993.

[Hos83] Josef Hoschek. Dual Bézier curves and surfaces. In Robert E. Barnhill and Wolfgang
Boehm, editors, Surfaces in Computer Aided Geometric Design. North-Holland, 1983.

[Hos87] Josef Hoschek. Approximate conversion of spline curves. Computer Aided Geometric
Design, 4:59–66, 1987.

[Hos88] Josef Hoschek. Intrinsic parameterization for approximation. Computer Aided Geometric
Design, 5:27–31, 1988.

[KM83] P. A. Koparkar and S. P. Mudur. A new class of algorithms for the processing of parametric
curves. Computer-Aided Design, 15:41–45, 1983.

[Kur80] A.G. Kurosh. Higher Algebra. MIR, 1980.

[Lac88] M. A. Lachance. Chebyshev economization for parametric surfaces. Computer Aided


Geometric Design, 5:195–208, 1988.

[Liu87] D. Liu. Algorithms for computing area and volume bounded by Bézier curves and surfaces.
Mathematica Numerica Sinica, 9:327–336, 1987.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
BIBLIOGRAPHY 261

[LM87] Tom Lyche and Knut Mørken. Knot removal for parametric B–spline curves and surfaces.
Computer Aided Geometric Design, 4:217–230, 1987.

[LR80] Jeffery M. Lane and Richard F. Riesenfeld. A theoretical development for the computer
generation and display of piecewise polynomial surfaces. IEEE Trans. RAMI, 2:35–46,
1980.

[MK84] S. P. Mudur and P. A. Koparkar. Interval methods for processing geometric objects.
IEEE Computer Graphics and Applications, 2:7–17, 1984.

[Moo66] R. E. Moore. Interval Analysis. Prentice–Hall, Englewood Cliffs, NJ, 1966.

[Moo79] R. E. Moore. Methods and Applications of Interval Analysis. SIAM, Philadelphia, 1979.

[NLL90] Horst Nowacki, D. Liu, and X. Lu. Fairing Bézier curves with constraints. Computer
Aided Geometric Design, 7:43–55, 1990.

[NSK90] Tomoyuki Nishita, Thomas W. Sederberg, and Masanori Kakimoto. Ray tracing trimmed
rational surface patches. Computer Graphics, 24:337–345, 1990.

[Ove68] A. W. Overhauser. Analytic definition of curves and surfaces by parabolic blending.


Technical report, Ford Motor Company, May 1968.

[Pat89] N. M. Patrikalakis. Approximate conversion of rational splines. Computer Aided Geo-


metric Design, 6:155–165, 1989.

[Ram87] Lyle Ramshaw. Blossoming: A connect-the-dots approach to splines. Technical Report 19,
Digital Equipment Corporation, Systems Research Center, Palo Alto, CA, June 1987.

[Ram89a] Lyle Ramshaw. Béziers and B-splines as multiaffine maps. In R. A. Earnshaw, editor,
Theoretical Foundations of Computer Graphics and CAD, volume 40 of ASI Series F,
pages 757–776. NATO, Springer-Verlag, 1989.

[Ram89b] Lyle Ramshaw. Blossoms are polar forms. Computer Aided Geometric Design, 6:323–358,
1989.

[Rok75] J. Rokne. Reducing the degree of an interval polynomial. Computing, 14:5–14, 1975.

[Sab87] Malcolm A. Sabin. Envelope curves and surfaces. In Ralph R. Martin, editor, The
Mathematics of Surfaces II, pages 413–418. Oxford University Press, 1987.

[SAG84] Thomas W. Sederberg, David C. Anderson, and Ronald N. Goldman. Implicit representa-
tion of parametric curves and surfaces. Computer Vision, Graphics and Image Processing,
28:72–84, 1984.

[Sal34] George Salmon. Higher Plane Curves. G.E.Stechert & Co., 1934.

[Sed89] Thomas W. Sederberg. Algorithm for algebraic curve intersection. Computer-Aided De-
sign, 21:547–554, 1989.

[Ser82] J. Serra. Image Analysis and Mathematical Morphology. Academic Press, New York,
1982.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014
262 BIBLIOGRAPHY

[SK91] Thomas W. Sederberg and Masanori Kakimoto. Approximating rational curves using
polynomial curves. In Gerald Farin, editor, NURBS for Curve and Surface Design, pages
149–158, Philadelphia, 1991. SIAM.
[SN90] Thomas W. Sederberg and Tomoyuki Nishita. Curve intersection using Bézier clipping.
Computer-Aided Design, 22:538–549, 1990.

[Som51] D. M. Y. Sommerville. Analytical Geometry of Three Dimensions. Cambridge University


Press, 1951.
[SP86a] Thomas W. Sederberg and Scott R. Parry. A comparison of curve-curve intersection
algorithms. Computer-Aided Design, 18:58–63, 1986.

[SP86b] Thomas W. Sederberg and Scott R. Parry. Free-form deformation of solid geometric
models. Computer Graphics, 20:151–160, 1986.
[Spe94] Melvin R. Spencer. Polynomial Real Root Finding in Bernstein Form. PhD thesis,
Brigham Young University, 1994.

[SW87] Thomas W. Sederberg and Xuguang Wang. Rational hodographs. Computer Aided Geo-
metric Design, 4:333–335, 1987.
[SWZ89] Thomas W. Sederberg, Scott C. White, and Alan K. Zundel. Fat arcs: a bounding region
with cubic convergence. Computer Aided Geometric Design, 6:205–218, 1989.
[SZSS98] T W Sederberg, J Zheng, D Sewell, and M Sabin. Non-uniform recursive subdivision
surfaces. Proceedings of SIGGRAPH 98, pages 387–394, July 1998. ISBN 0-89791-999-8.
[Tim80] Harry G. Timmer. Alternative representation for parametric cubic curves and surfaces.
Computer-Aided Design, 12:25–28, 1980.
[Win23] R. M. Winger. An Introduction to Projective Geometry. D. C. Heath and Company, 1923.

[WS93] Guo-Jin Wang and Thomas W. Sederberg. Convergence conditions for hermite approxi-
mation of rational functions. submitted, 1993.
[WW88] Mark A. Watkins and Andrew J. Worsey. Degree reduction of Bézier curves. Computer-
Aided Design, 20:398–405, 1988.

T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes October 9, 2014

You might also like