MA 323 Geometric Modelling Course Notes: Day 12 de Casteljau s Algorithm and Subdivision

Similar documents
MA 323 Geometric Modelling Course Notes: Day 11 Barycentric Coordinates and de Casteljau s algorithm

MA 323 Geometric Modelling Course Notes: Day 07 Parabolic Arcs

MA 323 Geometric Modelling Course Notes: Day 20 Curvature and G 2 Bezier splines

The Essentials of CAGD

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

CMSC427 Parametric curves: Hermite, Catmull-Rom, Bezier

Algebra II Learning Targets

MAT300/500 Programming Project Spring 2019

CSE 167: Lecture 11: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Interpolation and polynomial approximation Interpolation

On-Line Geometric Modeling Notes

MATHEMATICS EXTENSION 2

3.1 Interpolation and the Lagrange Polynomial

1.1. The analytical denition. Denition. The Bernstein polynomials of degree n are dened analytically:

Katholieke Universiteit Leuven Department of Computer Science

Lagrange Interpolation and Neville s Algorithm. Ron Goldman Department of Computer Science Rice University

Exhaustion: From Eudoxus to Archimedes

Introduction. Chapter Points, Vectors and Coordinate Systems

Algebra 2 Khan Academy Video Correlations By SpringBoard Activity

Algebra 2 Khan Academy Video Correlations By SpringBoard Activity

Curves, Surfaces and Segments, Patches

Rewriting Polynomials

Introduction to Computer Graphics. Modeling (1) April 13, 2017 Kenshi Takayama

CS 536 Computer Graphics NURBS Drawing Week 4, Lecture 6

SMT Power Round Solutions : Poles and Polars

IB Mathematics HL Year 2 Unit 11: Completion of Algebra (Core Topic 1)

Use estimation strategies reasonably and fluently while integrating content from each of the other strands. PO 1. Recognize the limitations of

Lecture 20: Bezier Curves & Splines

V. Adamchik 1. Recurrences. Victor Adamchik Fall of 2005

R1: Sets A set is a collection of objects sets are written using set brackets each object in onset is called an element or member

2 The De Casteljau algorithm revisited

Contents. CHAPTER P Prerequisites 1. CHAPTER 1 Functions and Graphs 69. P.1 Real Numbers 1. P.2 Cartesian Coordinate System 14

WAYNESBORO AREA SCHOOL DISTRICT CURRICULUM ALGEBRA II

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 133 Part 2. I. Topics from linear algebra

Lecture 20: Lagrange Interpolation and Neville s Algorithm. for I will pass through thee, saith the LORD. Amos 5:17

Curves. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Taku Komura

Subdivision Matrices and Iterated Function Systems for Parametric Interval Bezier Curves

Miller Objectives Alignment Math

Exercises for Unit I (Topics from linear algebra)

Exercises for Unit I (Topics from linear algebra)

An O(h 2n ) Hermite approximation for conic sections

Bézier Curves and Splines

BUILT YOU. ACT Pathway. for

SERIES

Recursive Definitions. Recursive Definition A definition is called recursive if the object is defined in terms of itself.

Arizona Mathematics Standards Articulated by Grade Level (2008) for College Work Readiness (Grades 11 and 12)

Recursive Definitions. Recursive Definition A definition is called recursive if the object is defined in terms of itself.

PRECALCULUS BISHOP KELLY HIGH SCHOOL BOISE, IDAHO. Prepared by Kristina L. Gazdik. March 2005

Readings for Unit I from Ryan (Topics from linear algebra)

Note that r = 0 gives the simple principle of induction. Also it can be shown that the principle of strong induction follows from simple induction.

Chapter 3: Root Finding. September 26, 2005

Introductory Mathematics

Sequenced Units for Arizona s College and Career Ready Standards MA40 Algebra II

1 ** The performance objectives highlighted in italics have been identified as core to an Algebra II course.

Curriculum Guide Algebra 2 Advanced

ELEMENTARY LINEAR ALGEBRA

Mathematics AKS

Prentice Hall CME Project, Algebra

MCPS Algebra II Pacing Guide

9th and 10th Grade Math Proficiency Objectives Strand One: Number Sense and Operations

Instructional Units Plan Algebra II

k 2r n k n n k) k 2r+1 k 2r (1.1)

Bernstein polynomials of degree N are defined by

Edexcel GCE Further Pure Mathematics (FP1) Required Knowledge Information Sheet. Daniel Hammocks

The Not-Formula Book for C1

West Windsor-Plainsboro Regional School District Advanced Algebra II Grades 10-12

1.1 Line Reflections and Point Reflections

1 Roots of polynomials

HSC Mathematics - Extension 1. Workshop 2

Chapter 4: Interpolation and Approximation. October 28, 2005

Intermediate Algebra

POLYNOMIALS CHAPTER 2. (A) Main Concepts and Results

Intermediate Level Learning Targets

MAT 243 Test 2 SOLUTIONS, FORM A

THE PYTHAGOREAN THEOREM

SMSU Mathematics Course Content

Do not open your test until instructed to do so!

The Research- Driven Solution to Raise the Quality of High School Core Courses. Algebra I I. Instructional Units Plan

Weekly Activities Ma 110

Syllabus. + + x + n 1 n. + x + 2

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Smooth Path Generation Based on Bézier Curves for Autonomous Vehicles

Year 1: Fall. HSA Topics - 2 Year Cycle

S56 (5.1) Polynomials.notebook August 25, 2016

Test Codes : MIA (Objective Type) and MIB (Short Answer Type) 2007

Novel polynomial Bernstein bases and Bézier curves based on a general notion of polynomial blossoming

A video College Algebra course & 6 Enrichment videos

1 2n. i=1. 2m+1 i = m, while. 2m + 1 = 1. is the best possible for any odd n.

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

Secondary Honors Algebra II Objectives

Math 353 Lecture Notes Week 6 Laplace Transform: Fundamentals

Algebraic. techniques1

DRAFT. Pre-calculus Curriculum Map Quarter 1 Chapters P 2. Extraneous Critical numbers Test intervals

Algebra Topic Alignment

Introduction to Curves. Modelling. 3D Models. Points. Lines. Polygons Defined by a sequence of lines Defined by a list of ordered points

High School Mathematics Honors PreCalculus

- 1 - Items related to expected use of technology appear in bold italics.

CAMI Education links: Maths NQF Level 4

Sophomore Year: Algebra II Textbook: Algebra II, Common Core Edition Larson, Boswell, Kanold, Stiff Holt McDougal 2012

Ordinary Differential Equation Introduction and Preliminaries

Transcription:

MA 323 Geometric Modelling Course Notes: Day 12 de Casteljau s Algorithm and Subdivision David L. Finn Yesterday, we introduced barycentric coordinates and de Casteljau s algorithm. Today, we want to go more in depth into the mechanics of de Casteljau s algorithm, and understand some of the nuances of the algorithm. We also want to discuss the efficiency of this algorithm in creating the curve. The algorithm s power is not necessarily in defining a polynomial curve, but in how the algorithm can approximate the curve it produces very quickly. In particular, de Casteljau s algorithm admits can be viewed as a subdivision method for creating an approximation to the curve. The idea of a subdivision method is a useful idea in geometric modelling and any numerical algorithm that employs recursion. A subdivision method is a recursive method for creating an approximation. For de Casteljau s algorithm, the subdivision method is based on noticing that the control polyline to the curve basically provides the shape of the curve. Moreover, when applying de Casteljau s algorithm the curve is further approximated by the portions of lines drawn. The subdivision algorithm provides a method for defining the points needed to approximate the curve. 12.1 de Casteljau s algorithm revisited Yesterday, we introduced the algorithm as a method for creating a curve by repeated linear interpolation from a collection of points. In particular, the algorithm is From the control points p 0, p 1,, p n, we define points on the line segments p i p i+1 (the control polyline) by choosing a value t and defining p 1 i = (1 t) p i + t p i+1. Notice that we defined n points in this manner as i = 0, 1, 2,, n 1. From the n points p 1 i, we can repeat the process and define the n 1 points p 2 i = (1 t) p1 i +t p1 i+1 on the line segments p1 i p1 i+1. This process can be repeated defining p j+1 i = (1 t) p j i + t pj i+1 for i = 0, 1, 2,, n j 1 for j = 0, 1, 2,, n 1 where p 0 i = p i. The end of this process produces a point p n 0 on a polynomial curve of degree n. An example of this procedure is shown in the diagram below constructing a cubic curve. Notice to calculate one point on the curve, we need to calculate the position of n points on the control polyline. Then, we calculate n 1 points using the line segments of the first n control points, and so on. Thus, we need to calculate n + (n 1) + (n 2) + + 2 + 1 = n(n + 1)/2 points to calculate one point, see diagram above de Casteljau s algorithm applied to n + 1 control points generates an nth degree polynomial curve. This follows from an inductive argument. We have demonstrated this algorithm for

12-2 Figure 1: Construction of a curve by repeated linear interpolation parabolas. If we assume that with n points, we get a n 1th degree polynomial curve. We note that the point p n 1 0 is obtained by applying de Casteljau s algorithm to the control points p 0, p 1,, p n 1, and thus is a n 1th degree polynomial curve. Moreover, the point p n 1 1 is obtained by applying de Casteljau s algorithm to the control points p 1, p 2,, p n, and therefore is also a n 1th degree polynomial curve. The point p n 0 = (1 t) p n 1 0 +t p n 1 1 on the curve is thus an nth degree polynomial in t. The same sort of inductive argument can be applied to show that de Casteljau s algorithm can be written in barycentric coordinates, that is c(t) = α0 n (t) p 0 + α1 n (t) p 1 + + αn(t) n p n where α 0 (t) + α 1 (t) + + α n (t) = 1. In particular, we have plus p n 1 0 (t) = α n 1 0 (t) p 0 + α n 1 1 (t) p 1 + α n 1 n 1 (t) p n 1 p n 1 1 (t) = α n 1 0 (t) p 1 + α n 1 1 (t) p 2 + α n 1 n 1 (t) p n with α0 n 1 (t) + α1 n 1 (t) + + αn 1 n 1 (t) = 1 by the induction hypothesis. This implies with c(t) = (1 t) p n 1 0 (t) + t p1 n 1 (t) that for we have and therefore α n 0 (t) + + α n n(t) c(t) = α n 0 (t) p 0 + α n 1 (t) p 1 + + α n n(t) p n α n 0 (t) = (1 t) α n 1 0 (t) α n 1 (t) = (1 t)α n 1 1 (t) + tα n 1 0 (t).. αi n (t) = (1 t)α n 1 i (t) + tα n 1 i 1 (t). α n n(t) = tα n 1 n 1 (t) = (1 t) (α0 n 1 (t) + + αn 1 n 1 (t)) + t (αn 1 0 (t) + + αn 1 n 1 (t)) = (1 t) + t = 1.

12-3 One can instead expand the algebra, (which we look at after break), and find that each basis function α i (t) is an nth degree polynomial curve, specifically ( ) n α i (t) = t i (1 t) n i i ( ) n where is a binomial coefficient that can be computed by Pascal s triangle. i 12.2 A Simple Method for Approximating the Curve The simplest method approximating the curve created by de Casteljau s algorithm is to divide the interval [0, 1] into a collection of subintervals, that is obtaining a partition 0 = t 0 < t 1 < t 2 < < t n = 1 of the interval [0, 1], and computing the points P (t 0 ), P (t 1 ),, P (t n ). An approximation of the curve is given by the linear interpolant through these points. Using more points and equal subdivisions t 1 t 0 = t 2 t 1 = = t n t n 1, we obtain a good approximation to the a continuous curve. This is a direct result of the continuity of the curve. This method does not take into account any facts about the algorithm. In fact, this method will work for any curve that is defined on a closed interval. We can increase the approximation accuracy of the approximation and the decrease the amount of time needed to compute the approximation by exploiting the nature of the algorithm. The subdivision algorithm that we will now discuss is built on using some of the intermediate points in de Casteljau s algorithm to achieve a good approximation of the curve. This method relies on the fact that the control polyline provides a first approximation of the curve, and exploiting a theorem from Euclidean geometry called Menelaus theorem. To explain the method, we will first use the method to construct an approximation of a parabola. Then, we will write an explicit description of the method. Given three noncollinear points P 0, P 1, P 2 as in the diagram below. We first apply de Casteljau s algorithm with t = 1/2 to obtain the points P0 1, P1 1, P0 2 where P0 2 is on the parabola. Notice, in this construction the linear interpolant through the points P 0 = P0 0, P0 1, P0 2, P1 1 and P2 0 = P 2 forms a better approximation to the parabola than the original control polyline. Moreover, if we consider the set P0 0, P0 1 and P0 2 as control points we have P0 0 and P0 2 as points on the parabola and P0 1 off the parabola, and the intersection of the tangent lines to the parabola at P0 0 and P0 2. We have a similar statement about the points P0 2, P1 1 and P2 0. In fact, if we apply de Casteljau s algorithm on the points P0 0, P0 1, P0 2, we obtain the same parabola. We likewise obtain the same parabola if we apply de Casteljau s algorithm on the points P0 2, P1 1, P2 0. Therefore, applying the same procedure on the points [P0 0, P0 1, P0 2 ] and the points [P0 2, P1 1, P2 0 ], we will obtain a better approximation with the corresponding points. 12.3 the Subdivision Method for de Casteljau s algorithm In our discussion of the subdivision method for de Casteljau s algorithm, we will restrict our attention to using midpoints of line segments. To approximate the curve given by de Casteljau s algorithm efficiently, we define an iteration process starting with the sequence of control points P 0, P 1, P 2,, P n. The sequence of control points defines the zeroth iteration as the control polyline (the linear interpolant or piecewise linear curve through the points P 0, P 1,, P n ). In the first iteration of the subdivision algorithm, we use de Casteljau s algorithm with t = 1/2 to calculate one point, and thus we split the curve into two segments. de Casteljau s

12-4 Figure 2: A better approximation to a parabola. Figure 3: The zeroth iteration of subdivision algorithm then defines a set of control points that will generate each curve segment. The control points P0 n i with i = 0, 1, 2,, n generate the segment P (t) with 0 t 1/2 and the control points P n i i with i = 0, 1, 2,, n generates the segment P (t) with 1/2 t 1. The linear interpolant PL 1 through the points P0 0, P0 1,, P0 n, P1 n 1, P2 n 2,, Pn 0 (the control polylines for the segments P (t) with 0 t 1/2 and P (t) with 1/2 t 1) forms a better approximation to the curve than PL 0. For an illustration see the diagram below. We continue the process in a recursive manner applying the method onto each segment. Thus, in the second iteration of the subdivision method, we subdivide the two segments of the original curve obtaining four segments of the original curve. The third iteration obtains eight segments of the original curve and so forth. After k iterations, we have 2 k segments of the original curve. We stated above that the control points P0 0, P0 1,, P0 n produce the segment of the curve P (t) with 0 t 1/2. To show that this is true involves a version of Menelaus theorem

12-5 Figure 4: The first iteration of subdivision Figure 5: The second iteration of subdivision 12.4 A Version of Menelaus Theorem The mathematical construction that allows a multivariate version of de Casteljau s algorithm to work is Menelaus theorem. Other formulations of de Casteljau s algorithm involve blossoming. In blossoming, each the subinterval from different iteration are given a different parameter, i.e. the construction of a parabola is written as (1 s)((1 t)p 0 + tp 1 ) + s((1 t)p 1 + tp 2 ). The parabola is then arrived at using s = t. That it does not matter which variable is computed first is a result of Menelaus theorem. A version of Menelaus theorem is given as let P 0, P 1, P 2 be three points in a plane. Define the points a 0 = (1 t) P 0 + t P 1 and a 1 = (1 t) P 1 + t P 2. Also define the points b 0 = (1 s) P 0 + s P 1 and b 1 = (1 s) P 1 + s P 2. Using algebra, it is easy to show that c = (1 s) a 0 + s a 1 = (1 t) b 0 + t b 1.

12-6 Figure 6: A CAGD version of Menelaus s Theorem This takes on special interest, when we recast it in terms of repeated linear interpolation. Define b[0, t] = (1 t) b 0 + t b 1 ; Further, define b[1, t] = (1 t) b 1 + t b 2 ; b[s, 0] = (1 s) b 0 + s b 1 ; b[s, 1] = (1 s) b 1 + s b 2. b[s, t] = (1 s) b[0, t] + s b[1, t] b[t, s] = (1 t) b[s, 0] + t b[s, 1]. Menelaus theorem implies that b[s, t] = b[t, s]. This gives us a multivariate way of repeatedly applying linear interpolation, and will be tremendously important later when we define surfaces using de Casteljau s algorithm. Here, we only need Menelaus theorem to show that the subdivision method works. In other books on geometric modelling, this result is used to motivate other constructions. In particular, this version of Menelaus theorem is used in blossoming. We will not mention in the remainder of the course, but for those of you who are interested in careers in computer graphics and CAGD should be aware of blossoming. Blossoming allows one to construct most of the geometric information about the curve as repeated linear interpolation. For more information on blossoming consult the text by Farin. The classical theorem of Menelaus (illustrated above) is stated in terms of ratios and used to determine when points are collinear. The ratio of three collinear points P, X and Q is defined through the barycentric coordinates of the middle point X in terms of the points P and Q. Since X lies on the line P and Q, X can be written in barycentric coordinates as X = (1 t) P + t Q for some number t. The ratio of P, X and Q is then defined as ratio(p, X, Q) = t 1 t The ratio(p, X, Q) is equal to the proportion of P X/P Q to XQ/P Q, where P X/P Q and XQ/P Q are defined by the division of lengths. The classical theorem of Menelaus concerns the collinearity of points defined through a triangle. Let ABC be a triangle and let X be

12-7 Figure 7: The classical version of the theorem of Menelaus a point on the line AB, Y be a point on the line BC and Z be a point on the line AC. Menelaus theorem states that the points X, Y and Z are collinear if and only if ratio(a, X, B) ratio(b, Y, C) ratio(c, Z, A) = 1. 12.5 Why the Subdivision Method Works From de Casteljau s algorithm (that the tangent line is given by P0 n 1 (t) and P1 n 1 (t)) and facts about parabolas, it should be geometrically obvious that the this holds true for parabolas. A parabola is well defined by two points and two tangent lines. However, if we approach this problem (showing that the control points P0 0, P0 1, P0 2 generates the segment of the curve P (t) with 0 t 1/2) in a more algebraic manner then we can extend the method to the general setting. To understand the application of Menelaus theorem to the subdivision method, consider the diagram below. The CAGD version of Menelaus theorem states that the intersection point X of the lines P 1 0 (1/2) P 1 1 (1/2) and P 1 0 (t) P 1 1 (t) in the diagram below is given by (1 t) P 1 0 (1/2) + t P 1 1 (1/2) = (1/2)[(1 t) P 0 + t P 1 ] + (1/2)[(1 t) P 1 + t P 2 ]. We note that the point P 1 0 (t) = (1 2t) P 0 + 2t P 1 0 (1/2) and the thus the point P 2 0 (t) = (1 2t) P 1 0 (1/2) + 2t P 2 0 (1/2). Therefore, since the point X = (1/2)[(1/2)[(1 t) P 0 + t P 1 ] + (1/2)[(1 t) P 1 + t P 2 ], we have that (1 t) 2 P 0 +2t(1 t) P 1 +t 2 P 2 is equal to (1 2t) 2 P 0 0 (1/2)+4t(1 2t) P 1 0 (1/2)+ (2t) 2 P 2 0 (1/2).

12-8 Exercises 1. Construct an approximation of the curve defined by de Casteljau s algorithm defined the control points below. Figure 8: Apply Subdivision Method for de Casteljau s algorithm (a) by applying the subdivision method twice. (b) by applying the subdivision method four times. 2. Complete the interactive exercises for the Subdivision Method.