Contour lines are traced through the grid matrix, which is the mathematical model of the surface that has been generated by Surface III. A bicubic spline is fitted to a grid cell using values at the nodes forming the corners of the cell and values of the nodes defining the eight adjacent cells. In addition to the estimated values themselves, the tangents to slopes between nodes are calculated, as well as "twist vectors" describing the slopes across the edges of adjacent cells.
The point at which a contour line intersects the side of a grid cell is determined by interpolation along the bicubic spline. Intermediate points are estimated on the surface of the bicubic spline inside the grid cell, subdividing it into a set of subcells. The points where the contour line will cross the edges of these subcells are located by linear interpolation, and the contour line is created by connecting these points with straight lines. Greater apparent smoothness of the contour lines can be achieved by specifying a finer set of subcells.
The use of bicubic splines for surface interpolation insures that the contoured surface has locally continuous first and second derivatives (there will be no abrupt changes in slope from cell to cell), and that successive contour lines will exhibit consistent relationships to each other.