CurvesInSpace.mw

Let's look at a space curve r(t) = i cos(t) + j sin(t) + k t 

 

Load the plots library so we can see what this looks like - we'll use the spacecurve command and then introduce the animate command. 

 

with(plots); 1 

[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
 

spacecurve([cos(t), sin(t), t], t = -2*Pi .. 2*Pi, thickness = 2, color = black, axes = normal); 1
spacecurve([cos(t), sin(t), t], t = -2*Pi .. 2*Pi, thickness = 2, color = black, axes = normal); 1
 

 

Plot 

 

Next let's animate the curve. First we'll set some standard options to use throughout 

 

opts := thickness = 2, numpoints = 100, color = black, axes = normal; 1
opts := thickness = 2, numpoints = 100, color = black, axes = normal; 1
 

thickness = 2, numpoints = 100, color = black, axes = normal 

 

To animate we want to create a number of frames, each one representing what the plot would look like at a time t. 

We create the default number (25) and then cycle through the frames so it looks like animation. 

 

So we will use the animate(...) command. First we need to tell animate that we want to use the spacecurve to plot. Next we supply the curve  

in the form of a vector - [x(s), y(s), z(s)] where s ranges from our start time up to t. We use this to define each frame. 

Next we allow t to vary from our start time to our end time. 

 

After we enter the command we position the cursor over the plot and right click. Select animate and then play. This will make one animition cycle. 

If you wish it to run continuously, select animate and then continuous then animate and play. It will run until you turn it off (by selecting animte followed by stop). 

 

 

 

 

animate(spacecurve, [[cos(s), sin(s), s], s = -2*Pi .. t, opts], t = -2*Pi .. 2*Pi); 1
animate(spacecurve, [[cos(s), sin(s), s], s = -2*Pi .. t, opts], t = -2*Pi .. 2*Pi); 1
 

 

Plot 

 

 

Now look at two curves. The first one is smooth and the second is not (dr/dt = 0 at t = 0).  

 

 

 

animate(spacecurve, [[s^5, s^3, s], s = -10 .. t, opts], t = -10 .. 10); 1 

 

Plot 

 

 

animate(spacecurve, [[s^5, s^3, s^2], s = -10 .. t, opts], t = -10 .. 10); 1 

 

Plot 

 

 

 

Here is one whose graph doesn't have a point or cusp. It is not smooth because it dr/dt = 0 at t = 0. Run the amination and watch the plot as t approaches 0. 

 

animate(spacecurve, [[0, 0, s^3], s = -10 .. t, opts], t = -10 .. 10); 1 

 

Plot