> with(plots):with(plottools):setoptions3d(axes=framed,labels=[x,Y,Z]);
How to do arrows (vectors) to visualize a moving R(t) position vector...
We will use a helix as an example.
> Helix:=spacecurve([cos(4*s),s,sin(4*s)],s=0..2*Pi,numpoints=100,color=red,thickness=3):display(Helix,scaling=constrained);
Next we take a parameter domain
and partition it:
> t:=evalf(seq(0+2*Pi*i/100,i=0..100));
Now Arrows is a sequence of arrows, tailed at [0,0,0], with heads at [ x(t[i]), y(t[i]), z(t[i]) ].
> Arrows:=seq(arrow(vector([0,0,0]), vector([cos(4*t[i]),t[i],sin(4*t[i])]),.1,.2,.1),i=1..100):
Finally we make a structure that consists of the i-th arrow together with the curve, and then displays these. Insequence=true actives the VCR control panel. Watch the arrow move along the helix!
>
Math216:=seq(display(Arrows[i],Helix),i=1..100):
display(Math216,axes=framed,insequence=true);
> t:='t';
Visualize the toriodal spiral discussed on page 706
> x:=t->(4+sin(20*t))*cos(t):
> y:=t->(4+sin(20*t))*sin(t):
> z:=t->cos(20*t):
> spacecurve([x(t),y(t),z(t)], t=0..2*Pi, axes=boxed,numpoints=500, scaling=constrained, thickness=2, color=red); Curve:=%:
We see that the curve lives on a torus of inner radius 3 and outer radius 5 (tube radius 1 and meridian radius 4). We use torus from the package plottools .
> Surface:=torus([0,0,0], 0.9, 4, style=patchnogrid):
We made the tube radius of the torus slightly less than 1 so that the torus will not obscure the curve.
> display(Surface, Curve, labels=[x,y,z]);
Visualize the Trefoil Knot on page 706
The trefoil knot is a basic example in a highly developed field of mathematics called knot thoery . Knot theory has found applications from genetics to theoretical quantum field theory.
> x:=t->(2+cos(1.5*t))*cos(t):
> y:=t->(2+cos(1.5*t))*sin(t):
> z:=t->sin(1.5*t):
> spacecurve([x(t),y(t),z(t)], t=0..4*Pi, color=red, numpoints=500, axes=framed,thickness=2, scaling=constrained, orientation=[57,57]);Curve:=%:
The author remarks that optical illusions make it especially difficult to get a good impression of what this curve looks like.
By comparing the equations for the trefoil knot and the toroidal spiral, we might guess that the tefoil knot also lives on a torus.
> Surface:=torus([0,0,0], .9, 2, style=patchnogrid):
> display(Surface, Curve, labels=[x,y,z]);
Our suspicion is confirmed, and the perspective added by the torus gives us a much better impression of the trefoil knot.
Keep in mind the usefulness of tubeplot to add perspective:
> tubeplot([x(t),y(t),z(t)], t=0..4*Pi, radius=.3, numpoints=70, axes=framed, scaling=constrained, orientation=[66,52], labels=[x,y,z]);
>
A miscellaneous example...placing a helix on a cylinder
> spacecurve([cos(4*t),t,sin(4*t),t=0..4*Pi],color=red,thickness=3,axes=framed,labels=[X,Y,Z],numpoints=300);C:=%:
> implicitplot3d(x^2+z^2=.9,x=-1.1..1.1,y=0..12,z=-1.1..1.1,style=patchnogrid);S:=%:
> display(C,S,scaling=constrained);
>