Homework 6. Assigned: Thu Apr 5. Due: Fri Apr 13 at 4 p.m.

Splines and Parametric Piecewise Cubic Hermite Polynomials
  1. Splines: write a Matlab function myspline(x,f,n,k) to plot a cubic spline passing through n+1 data points (xi,fi), i=1,...n+1, plotted at k additional points in each interval (xi, xi+1). Follow the algorithm described in Section 11.2 of the text, where the notation is actually for data points (xi,fi), i=0,...n: unfortunately Matlab doesn't allow zero-subscripting. Use the free boundary (natural spline) conditions. Although the derivation is complicated, the algorithm is not:
  2. Parametric Piecewise Cubic Hermite Polynomials (Bezier Polynomials): show that the formula for X(&tau) and Y(&tau) given 2/3 of the way down the page on p.253 indeed satisfies the conditions 1/3 of the way down the page, with the derivatives scaled by 3 as explained in the middle of the page. To do this you need to
  3. Exercise 8, p. 256 of the text, following the pattern shown in Example 11.7, p. 253-254. Use only Bezier polynomials. You should use ginput and plot but you may not use any built-in interpolation routines such as spline, etc. Email myspline.m and tridiag.m to the grader, zz299@nyu.edu, with a cc to me. He will test them on his own input. Questions 2 and 3 can be turned in either on paper or by submitting a single pdf file by email. Don't forget to include the plot that shows the guidepoints as well as the interpolation points, as well as your source code.

Reading: Chapter 11, except Section 11.3