Mathematical Principles for Scientific Computing and Visualization  
http://www.farinhansford.com/books/scv
by Gerald Farin and Dianne Hansford

This notebook demonstrates plotting of bivariate functions: z = f(x,y).
One must choose the domain over which to evaluate -- min and max x and y values.

Also in this notebook is a contour of a bivariate function. This is a plot of the point set where f(x,y) = constant. 

Figure 11.1 was created with this notebook.

See Chapter 11: Computing with Multivariate Functionsfor details.

Updated May 2008

(* Set output folder to folder this files lives in *)
(SetDirectory[ToFileName[Extract["FileName"/.NotebookInformation[EvaluationNotebook[]],{1},FrontEnd`FileName]]];) 

(* Create a function *)

(f[x_,y_]:=Sin[(x^2)+(y^2)];) 


(* Plot it over a particular domain *)

Plot3D[f[x,y],{x,-(π/2),(π/2)},{y,-(π/2),(π/2)},BaseStyle->{"FontFamily"->"Helvetica","FontSize"->11}] 

(* Output a postscript file *)

(* Export["funct_example.eps",%] *)

Now change the domain -- here it is a small piece of what was plotted above.
The function looks fairly diferent!

Plot3D[f[x,y],{x,0,(π/2)},{y,0,(π/2)},BaseStyle->{"FontFamily"->"Helvetica","FontSize"->11},ColorOutput->GrayLevel]


(* Output to a postscript file *)
(* Export["funct_exampe2.eps",%] *)

Let's look at the contour plot of the function -- over the domain in the first plot.
In this plot, we plot the contours at 15 different z-levels.

(This plot differs from what is in the book because the implementation in 6.0 differs from 5.2.

Mathematica's default setting for the number of subdivisions to allow in the calculation of the contour is

contplot=ContourPlot[f[x,y],{x,-(π/2),(π/2)},{y,-(π/2),(π/2)},Contours->15,ContourShading->True]

(* Here is an effort to make the contour less smooth as in the text -- no luck! *)

contplot2=ContourPlot[f[x,y],{x,-(π/2),(π/2)},{y,-(π/2),(π/2)},Contours->15,ContourShading->True, MaxRecursion->1]

(* Export["contoursshaded.eps",contplot]; *)