Surface

443 days ago by ketchers

reset() var('x,y,t') @interact def _(f=x*y^2/(x^2+y^4),xmin=-2,xmax=2,ymin=-2,ymax=2,STEP=.2): P=plot3d(f,(x,xmin,xmax),(y,ymin,ymax),opacity=.7,color=(.7,.7,.7)) for i in [xmin..xmax,step=STEP]: P+=parametric_plot3d((i,t,f(x=i,y=t)),(t,ymin,ymax),color="red") for i in [ymin..ymax,step=STEP]: P+=parametric_plot3d((t,i,f(x=t,y=i)),(t,xmin,xmax),color="blue") Q=contour_plot(f,(x,xmin,xmax),(y,ymin,ymax),colorbar=True) show(Q);show(P) 
       

Click to the left again to hide and once more to show the dynamic interactive window

More interesting surfaces can be found at here.

reset() var('x,y,z') @interact def _(w=0,f = (x^2 + y^2 + z^2 - 1)^2 - ((z - 1)^2 - 2*x^2)*((z + 1)^2 - 2*y^2),min=-2,max=2): P=implicit_plot3d(f==w,(x,min,max),(y,min,max),(z,min,max)) html('$f(x,y,x)\;=\;%s\;=\;%s'%(latex(f),w)) show(P) 
       
min 
max 

Click to the left again to hide and once more to show the dynamic interactive window

var('s,t') R=5;r=1 x=R*cos(t)-r*s*sin(t/2)*cos(t) y=R*sin(t)+r*s*sin(t/2)*sin(t) z=r*s*cos(t/2) parametric_plot((x,y,z),(s,-1.5,1.5),(t,0,2*pi))