> #sfb jan 30, 2005 from gradtex > with(plots):with(plottools): > e:=exp(1):fun:= 3*(1-x)^2*e^(-x^2-(y+1)^2) > - 10*(x/5-x^3-y^5)*e^(-x^2-y^2) -(1/3)*e^(-(x+1)^2-y^2):xrange:=-3..3: > fun:=(x^2-1)*(y^2-1):xrange:=-1.5..1.5: > fun:=sin(x)*sin(y):xrange:=0..2*Pi: > fun:=cos(2*x)+y^2:xrange:=-Pi..Pi: > fstring:=convert(fun,string):ftitle:="Fun "||fstring: > a:=contourplot(fun,x=xrange,y=xrange,contours=15,coloring=[blue,red]): > b:=plot3d(fun,x=xrange,y=xrange,contours=15,shading=Z,style=patchcontour): > A:=op(op(b)[1])[3]:M1:=max(op(convert(A,set))):M0:=min(op(convert(A,set))): > display(a,scaling=constrained,title=ftitle); > t:=transform(unapply([x,y, M0-(M1-M0)/3],x,y)): > display(t(a),b,title=ftitle); >