Construct the torus using the command "tubeplot".
> restart;
> with(plots):
Warning, the name changecoords has been redefined> c:=tubeplot([cos(t),sin(t),0],t=0..2*Pi,scaling=constrained,radius=0.3,grid=[30,50],color=blue):
> with(plottools):
> vrml(c,"d:/9/8-1.wrl",background_color=white):
> c;
Construct two tori as thus:
> restart;
> with(plots):
Warning, the name changecoords has been redefined> a:=tubeplot([2*cos(t),2*sin(t),0],t=0..2*Pi,scaling=constrained,radius=0.6,grid=[30,30],color=blue):
> b:=tubeplot([2+2*cos(t),0,2*sin(t)],t=0..2*Pi,scaling=constrained,radius=0.6,grid=[30,30],color=green):
> c:=display(a,b):
> with(plottools):
> vrml(c,"d:/9/8-2.wrl",background_color=white):
> c;
Construct the torus using the command "plot3d".
> restart;
> r:=3+cos(t):
> x:=r*cos(s):y:=r*sin(s):z:=sin(t):
> c:=plot3d([x,y,z],s=0..2*Pi,t=0..2*Pi,scaling=constrained,color=blue):
> with(plottools):
> vrml(c,"d:/9/8-3.wrl",background_color=white):
> c;
Construct the torus by pasting two patches as thus:
> restart;
> with(plots):
Warning, the name changecoords has been redefined> k:=5:
> r:=3+cos(t):
> x:=r*cos(s):y:=r*sin(s):z:=sin(t):
> s:=u+v:
> t:=k*u:
> a:=plot3d([x,y,z],u=0..2*Pi,v=0..Pi/k,scaling=constrained,color=yellow,grid=[100,20]):
> b:=plot3d([x,y,z],u=0..2*Pi,v=Pi/k..2*Pi/k,scaling=constrained,color=blue,grid=[100,20]):
> c:=display(a,b):
> with(plottools):
> vrml(c,"d:/9/8-4.wrl",background_color=white):
> c;
Construct one half of a torus so its cross-section consists of two concentric circles.
> restart;
> r:=3+cos(t):
> x:=r*cos(s):y:=r*sin(s):z:=sin(t):
> c:=plot3d([x,y,z],s=0..2*Pi,t=0..Pi,scaling=constrained,color=blue):
> with(plottools):
> vrml(c,"d:/9/8-5.wrl",background_color=white):
> c;
Construct one half of a torus so its cross-section consists of two disjoint circles.
> restart;
> with(plots):
Warning, the name changecoords has been redefined> c:=tubeplot([cos(t),sin(t),0],t=0..Pi,scaling=constrained,radius=0.5,grid=[30,50],color=blue):
> with(plottools):
> vrml(c,"d:/9/8-6.wrl",background_color=white):
> c;
Construct one half of a torus so its cross-section consists of two intersecting circles.
> restart;
> a:=3:b:=4:c:=sqrt(a^2+b^2):
> r:=c+a*cos(t):
> x:=r*cos(s):y:=r*sin(s):z:=a*sin(t):
> u:=solve(b*z=a*x,s):
> c:=plot3d([x,y,z],s=-u..u,t=0..2*Pi,scaling=constrained,grid=[40,100],color=blue):
> with(plottools):
> vrml(c,"d:/9/8-7.wrl",background_color=white):
> c;
Construct one half of a torus so its cross-section consists of two interlocking circles in space.
> restart;
> x0:=5*cos(t):
> y0:=3+5*sin(t):z0:=0:
> s:=arccos(4/5):
> x1:=x0*cos(s)-z0*sin(s):y1:=y0:z1:=x0*sin(s)+z0*cos(s):
> x:=x1*cos(u)-y1*sin(u):y:=x1*sin(u)+y1*cos(u):z:=z1:
> c:=plot3d([x,y,z],t=0..2*Pi,u=0..Pi,scaling=constrained,color=blue):
> with(plottools):
> vrml(c,"d:/9/8-8.wrl",background_color=white):
> c;
Construct a knot as thus:
> restart;
> with(plots):
Warning, the name changecoords has been redefined> r:=3+cos(5/2*s):
> x:=r*cos(s):y:=r*sin(s):z:=sin(5/2*s):
> c:=tubeplot([x,y,z],s=0..5*Pi,radius=0.7,grid=[100,20],scaling=constrained,color=blue):
> with(plottools):
> vrml(c,"d:/9/8-9.wrl",background_color=white):
> c;
Construct knots as thus:
> restart;
> with(plots):
Warning, the name changecoords has been redefined> r:=3+cos(1/5*s):
> x:=r*cos(s):y:=r*sin(s):z:=sin(1/5*s):
> c:=tubeplot([x,y,z],s=0..10*Pi,radius=0.3,grid=[100,20],scaling=constrained,color=blue):
> with(plottools):
> vrml(c,"d:/9/8-10.wrl",background_color=white):
> c;
Construct a twisted torus whose sections are formed by regular triangles:
> restart;
> p:=2/3*Pi:
> r1:=3+cos(t/3):
> x1:=r1*cos(t):y1:=r1*sin(t):z1:=sin(t/3):
> r2:=3+cos(t/3+p):
> x2:=r2*cos(t):y2:=r2*sin(t):z2:=sin(t/3+p):
> x:=(1-s)*x1+s*x2:y:=(1-s)*y1+s*y2:z:=(1-s)*z1+s*z2:
> c:=plot3d([x,y,z],s=0..1,t=0..6*Pi,scaling=constrained,grid=[3,80],color=blue):
> with(plottools):
> vrml(c,"d:/9/8-11.wrl",background_color=white):
> c;
>