First give the command
with(plots);
to load the necessary routines.
Specifying the animated plot is easy: You simply include a third parameter, and it automatically changes with time when you run the animation. Example:
To plot
for
and
, where
changes with
time from
to
, type
animate3d([t,u,sin(t+v)*sin(u)],t=-Pi..Pi,u=-Pi..Pi,v=0..2*Pi);
First, you will see just the first frame, and then you will have
to wait while Maple generates additional frames (not yet shown).
Then on the Animate
menu, select Play
. This will play
it once, probably too fast. You can slow it down by selecting another
menu item. You can also set it to loop over and over by selecting the
continuous
menu item. Stop it by selecting Stop
, which
will have appeared on the Animate
menu.
What is really happening is that Maple makes eight frames, while varying
the third parameter ( in the example above).
In the example above, the range of the third parameter has
been chosen so that the last value of
gives the same plot as
the first value, to have continuous plotting make sense. But
then in continuous plotting, there is a resulting jerkiness when
the first and last plots are played in succession! In other words,
one plot is doubled. To fix that, use this trick:
animate3d([t,u,sin(t+v)*sin(u)],t=-Pi..Pi,u=-Pi..Pi,v=0..2*Pi*7/8);
Thus the eight plots are fractions
of the full range
of
, and the next plot 0 fits exactly into the sequence to make a
smooth continuous animation.
If you have an animation where the third parameter does not finish
where it starts, for example, a radius goes from 0 to 1, then
there is a trick to make it continuous so you can loop: First,
realize that
goes from 1 to
and back as
goes from 0 to
. Therefore
goes
from 0 to 1 and back. Substitute this expression for
in
your function to make a plot that can loop smoothly. Or if
is to go from 2 to 5 and back, you could use
.
Notice that rather than
was used for the
time-related parameter in the example above. It might be better
to use
for parameters so
is time.