You are to write a program that will compute and evaluate a natural cubic spline. The input data should include the number of nodes N, the node values X(i), and the corresponding function values Y(i), for i = 1, 2, ..., N. As discussed in our text on pages 300 through 306, this process can be broken up into three phases:
1. Setup the tridiagonal system of linear equations to be solved. This is specified in the first half of the pseudocode on page 302.
2. Solve the tridiagonal system of equations to get the vector a. This can be accomplished however you see fit. You may use your existing equation solving routines from Lab 4; you could implement a method specific to tridiagonal systems, such as the Gauss-Thomas method (page 112-117), LU Factorization (page 136 & 148), or an iterative method such as Successive Over Relaxation (page 223).
3. Create a function that implements the evaluation of the cubic spline as described on pages 300 and 303.
Test your program by using the 7 data points from the previous program and your graphing procedure to sketch the graph of the natural cubic spline on the interval from -1.0 to 1.0. A comparison of this graph with the graph of the sixth degree interpolating polynomial should be interesting.