cylinder_sphere_and_torus_pix_only.mws

A cylinder. The generating curve is shown in red. The axis v is shown in blue.

> restart:
rc:=[cos(t1),sin(t1+sin(t1)),0];
v:=[1,1,3];
r:=rc+t2*v;
r:=rc+expand(t2*v);
arr:=plottools[arrow]([0,0,-1.5],convert(v,vector),.1, .2, .05,color=blue):
c:=plots[spacecurve](rc,t1=0..2*Pi,thickness=3,color=red):
cyl:=plot3d(r,t1=0..2*Pi,t2=-1/3..1/3,grid=[50,11]):
plots[display](arr,c,cyl,scaling=constrained,axes=boxed,lightmodel=light2);

rc := [cos(t1), sin(t1+sin(t1)), 0]

v := [1, 1, 3]

r := [cos(t1), sin(t1+sin(t1)), 0]+t2*[1, 1, 3]

r := [t2+cos(t1), t2+sin(t1+sin(t1)), 3*t2]

[Maple Plot]

A sphere, parametrized by latitude (l) and longitude (g)

> restart:
r:=[cos(l)*cos(g),cos(l)*sin(g),sin(l)];
plot3d(r,l=-Pi/2..Pi/2,g=-Pi..Pi,
scaling=constrained,axes=boxed,lightmodel=light2);

r := [cos(l)*cos(g), cos(l)*sin(g), sin(l)]

[Maple Plot]

If we like, we can add the equator and the prime meridian (each a parametric curve):

> equator:=subs(l=0,r);
prime_meridian:=subs(g=0,r);

equator := [cos(0)*cos(g), cos(0)*sin(g), sin(0)]

prime_meridian := [cos(l)*cos(0), cos(l)*sin(0), si...

> p_eq:=plots[spacecurve](equator, g=-Pi..Pi ,thickness=3,color=red):
p_pm:=plots[spacecurve](prime_meridian,l=-Pi/2..Pi/2,thickness=3,color=blue):
p_surf:=plot3d(r,l=-Pi/2..Pi/2,g=-Pi..Pi):
plots[display](p_eq,p_pm,p_surf,scaling=constrained,axes=boxed,lightmodel=light2);

[Maple Plot]

>

A donut (surface), also called a "torus", parametrized by two angles, longitude (g) and something like latitude (l)

> restart:
R:=5+2*cos(l);
r:=[R*cos(g),R*sin(g),2*sin(l)];
plot3d(r,l=-Pi..Pi,g=-Pi..Pi,
scaling=constrained,axes=boxed,lightmodel=light2);

R := 5+2*cos(l)

r := [(5+2*cos(l))*cos(g), (5+2*cos(l))*sin(g), 2*s...

[Maple Plot]

As before, we can if we like add the "equator" and "prime meridian" :

> equator:=eval(subs(l=0,r));
prime_meridian:=eval(subs(g=0,r));

equator := [7*cos(g), 7*sin(g), 0]

prime_meridian := [5+2*cos(l), 0, 2*sin(l)]

> p_eq:=plots[spacecurve](equator, g=-Pi..Pi ,thickness=3,color=red):
p_pm:=plots[spacecurve](prime_meridian,l=-Pi..Pi,thickness=3,color=blue):
p_surf:=plot3d(r,l=-Pi..Pi,g=-Pi..Pi):
plots[display](p_eq,p_pm,p_surf,scaling=constrained,axes=boxed,lightmodel=light2);

[Maple Plot]

>