Extrapolating the techniques developed in Chapter 8, which were used to produce two dimensional splines, to three dimensions is easy: all you need to do is add a few lines to the program. These lines are the bold highlighted lines in Listing 9-1, particularly those in function plotspline() from lines 89 to 161. They introduce the z coordinate in a syntax that is essentially the same as used for the x and y coordinates.
Control of Listing 9-1 begins at line 175. The first set of data points are defined by lists x,y, and z in lines 175-177. These have been nullified with the # symbol but are left ...