P0 P3 P1 P2 Q0 Q1 Q2 R0 R1 B (t0) MATH 164, Spring 2001 Due Date: Name(s): Honors Project 8a: Bezier Curves Bezier curves (such as the one to the right) are frequently used in computer drawing programs. A curves such as this is drawn by locating numerous points along it and "connecting the dots" (the assumption being that the eye cannot distinguish between a smooth curve and a many-sided polygonal arc). In this project we describe an algorithm -- the deCastlejau algorithm -- for constructing Bezier curves. Narrative To construct a Bezier curve segment of degree n we begin by selecting n + 1 points in the plane. The first and last points are the endpoints of the curve segment; the intermediate points help "guide the curve", but they usually do not lie on it. The points n + 1 are called control points of the Bezier curve, and the segments joining them in order form its control polygon. In this project we consider the case n = 3, although everything we say is true if n = 2 or n > 3. Suppose the points we have selected are P0(x0, y0), . . . , P3(x3, y3). The deCastlejau algorthm for finding the point on the curve that corresponds to the parameter value t = t0, 0 t0 1, is based on linear interpolation, and, indeed, applying it repeatedly: A parametrization of the segment P0P1 is given by x = (1 - t)x0 + tx1, y = (1 - t)y0 + ty1, where t [0, 1]. We can abbreviate the above notation by writing (1 - t)P0 + tP1, meaning we perform the indicated operation on both components. For a given parameter value t0 we find a point Q0 on P0P1 that is t0 of the distance from P0 to P1: Q0 = (1 - t0)P0 + t0P1. (This process is known as linear interpolation.) Similarly we find points on P1P2 and P2P3: Q1 = (1 - t0)P1 + t0P2 and Q2 = (1 - t0)P2 + t0P3. Then we interpolate again using the same parameter value t0 to find points R0 and R1 on Q0Q1 and Q1Q2: R0 = (1 - t0)Q0 + t0Q1 and R1 = (1 - t0)Q1 + t0Q2. The point B(t0) on the curve we are constructing, is B(t0) = (1 - t0)R0 + t0R1. Tasks 1. Choose 4 points in the plane and carry out this construction for the values t0 = 1/3 and t0 = 2/3. 2. Show that the expanded and simplified formula for B(t) is B(t) = (1 - t)3 P0 + 3t(1 - t)2 P1 + 3t2 (1 - t)P2 + t3 P3. Confirm that the curve starts at P0 when t = 0 and ends at P3 when t = 1. 3. a) Compute the derivative B (t). b) Find the derivatives at t = 0 and t = 1. c) Find the lines tangent to the curve at the beginning and ending points. d) Show that the tangent line at S is the line through R0 and R1. 4. Carry out the deCastlejau construction for the case n = 2, with 3 points. 5. Find the formula for B(t) in the case n = 2. 6. Show that if n = 2 then B(1/2) lies midway between P1 and M, the midpoint of segment P0P2. This point is called the shoulder point of the curve. 7. Show that for n = 2 the curve is an arc of a parabola from P0 to P2. (Hint: Consider eliminating the parameter t.) Contributor: Dr. Richard Patterson Department of Mathematical Sciences, IUPUI