## Homework assignments

 Date given Date due Assignment 7/3/2001 14/3/2001 Implement the De-Casteljau algorithm for evaluating a planar Bezier curve of any degree. Write a program that gets as input a degree d and d+1 control points (in the plane) and draws the curve Demonstrate by drawing the meaning of affine invariance and the convex hull property 14/3/2001 21/3/2001 Write a program that performs degree elevation of a Bezier curve, from any degree d to degree d+1. Demonstrate by drawings, for a particular Bezier curve, how the control points tend to the curve when the degree increases. Choice question, for serious students: Find a way to empirically measure the rate of convergence of control points to the Bezier curve when performing degree elevation. 21/3/2001 28/3/2001 Write a function that evaluates the point and the first partial derivatives of a bicubic (degree=3) Bezier patch at given (u,v) parameters. Write a program that draws a given bicubic Bezier patch - either as wireframe, or as a shaded surface. Demonstrate 1 or 2 surfaces. Choice question: Implement the Newton method for intersecting a line with a Bezier patch. The input consists of an infinite line (3d point + 3d direction) and a bicubic Bezier patch, as well as an initial guess of (u,v) parameters to start the iterations. Find a case where the iterations do not converge even though the line intersects the surface, due to a bad choice of the initial guess. How many iterations does it take to reach the exact solution within computer precision? 28/3/2001 18/4/2001 Write a function that evaluates the value and the first derivative of a (uniform) B-spline of given order (=degree+1) in a given parameter value. Use that program to display the graphs of the B-splines of orders 1,2,3,4,5,6 (i.e. display the basis functions). Write a program that displays a uniform B-spline curve given the control points in the plane and the order (=degree+1). Add to that program an option to display the tangent line to the given curve at a given parameter value. 18/4/2001 2/5/2001 Write a function that evaluates a B-spline (basis function) with given knots at a given parameter value, including its first derivative. Use that program to display the graphs of B-splines over various knot sequences. Demonstrate what happens when knots get closer together and reach a multiple knot. Write a program that displays a non-uniform B-spline curve given the control points in the plane, and given knots. 2/5/2001 9/5/2001 Write a function that performs knot insertion. The input is a NUBS curve (ord, knot sequence, and control point), and a knot to insert. The function calculate a new NUBS curve which is identical parametrically and geometrically to the original one, and has one more knot and one more control point. Demonstrate it for a number of curves by drawing the control points before and after the operation. Write a program that displays a Tensor Product NUBS surface in wireframe mode. Namely, display iso parameteric curve on the surface, corresponding to the knots in U and in V. Demonstrate surfaces of different orders, and with different knot sequences. 9/5/2001 23/5/2001 Write a function that displays a given NURBS curve. The input is a NURBS curve (ord, knot sequence, and control points with weights). Demonstrate the effect of changing the weight at one control point. Show that the curve is pulled towards the control point, as its weight increases. Write a function that calculate a NURBS representation for an arc. The user gives as input three points in the plane. You have to find the NURBS curve that represents exactly the arc going through the three points. This should work for arcs whose angle is up to 180 degrees. 16/5/2001 6/6/2001 Write a function that gets as input a closed 2d polygon and a given subdivision mask, and applies one iteration of subdivision according to the given mask, to the given polygon. The result is a polygon with twice as many vertices. Use the above function to demonstrate B-spline subdivision of orders 2,3,4,5. Demonstrate that the subdivision process is converging to a smooth limit curve. Use the above function to demonstrate the 4 point scheme with the following values of the tension parameter w : 0,0.02,0.04,0.0625,0.1,0.15,0.2,0.5. Run 4 or 5 iterations in each case to get enough points on the generated curves. What values of w yield smooth curves?