Three-dimensional plotting
Equations (3.4) and (3.5) define two mathematical functions that are more complicated to visualize and plot compared to the simple polynomials in the previous section. Equation (3.4) is a scalar function that depends on two variables. The graph of such a function can be visualized via a surface plot. Equation (3.5) is a vector valued function and can be plotted as a parametric curve in a three-dimensional space. In this section, we shall see how to do this.
Surface plot
Let us start by making a surface plot of the graph of Equation (3.4) in the interval x ∈ [ 2; 2] and y ∈ [ 2; 2]. Since we work with discrete points,we need to evaluate the range of f for all different combinations (x1y1), (x2y1),...(xnyn). To do this in an easy way in Octave, we generate two mesh grids such that all combinations can be included when we calculate the graph of f.