Surface and Contour
First we need the "draw" package.--> load(draw)In a 3D plot a function is described in the format
--> f(x,y) := x*y*exp(-x^2-y^2);
We can draw a surface when "enhanced3d=true" is specified.
--> draw3d(enhanced3d=true,
explicit(f(x,y),x,-2,2,y,-2,2),
user_preamble="unset colorbox")
We can obtain contour curves
when "contour=map" is specified.
--> draw3d(color=red, contour=map, contour_levels=15,
explicit(f(x,y),x,-2,2,y,-2,2),
user_preamble="unset clabel")
We can draw both the surface and the contour curves
when "contour=both" is specified.
--> draw3d(surface_hide=true, contour=both, contour_levels=15,
explicit(f(x,y),x,-2,2,y,-2,2))
The option "contour_levels"
can be chosen from the following styles.
- "
contour_levels=n" n is set to the number of contour lines drawn at equal intervals. - "
contour_levels=[a,s,b]" The contour curves are plotted from the lowest value a to the highest value b in steps of the value s. - "
contour_levels={c1,c2,...,cn}" The contour curves are plotted at the values c1, c2,...,cn.
The following wxm file include some of graphical demonstrations assigned in the class.
© TTU Mathematics