Lab 4. Functions of Two Variables. Level Curves and Contour Curves.

f[x_,y_]:=100-x^2-y^2 (* function of two variables *)
ContourPlot3D[z==f[x,y],{x,-10,10},{y,-10,10},{z,0, 100},Mesh->None,AxesLabel->{x,y,z}]

(* Let us plot level curves for this function in the xy-plane*)
ContourPlot[f[x,y],{x,-10,10},{y,-10,10},ContourLabels -> True]
ContourPlot[f[x,y] == 0,{x,-10,10},{y,-10,10}, ContourLabels -> True]
ContourPlot[f[x,y] == 51,{x,-10,10},{y,-10,10},ContourLabels -> True]
ContourPlot[f[x,y] == 75,{x,-10,10},{y,-10,10},ContourLabels -> True]

g[x_,y_]:=(4x^2+y^2)Exp[-x^2-y^2] (* function of two variables *)
ContourPlot3D[z==g[x,y],{x,-2,2},{y,-2,2},{z,0, 5},Mesh->None,AxesLabel->{x,y,z}]
ContourPlot[g[x,y],{x,-2,2},{y,-2,2},ContourLabels -> True]

(* A cool function to plot *)
cool[x_,y_]:= Sin[x+2Cos[y]]
ContourPlot3D[z == cool[x, y], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi},{z,-1,1},Mesh->None,AxesLabel->{x,y,z}]
(* Level curves in the xy-plane *)
ContourPlot[cool[x, y], {x, -2Pi, 2Pi}, {y, -2Pi, 2Pi}, ContourLabels -> True]
ContourPlot[cool[x, y] == 0.5, {x, -2Pi, 2Pi}, {y, -2Pi, 2Pi}, ContourLabels -> True]

(* Several level surfaces chosen automatically by Mathematica *)
ContourPlot3D[x^2+y^2+z^2 ,{x,-10,10},{y,-10,10},{z,-10,10},Mesh->None]
(* One way to specify several chosen contours *) 
ContourPlot3D[x^2+y^2+z^2,{x,-5,5},{y,-5,5},{z,-5,5},Mesh->None, Contours->{3, 3}]