Animations on Maple

460 Views Asked by At

I'm working on some textbook problems for Maple, and I encountered the following problem:

Create an animation to illustrate the differences between line thicknesses in Maple (you can choose any function to plot). After the thicknesses, illustrate line styles. Note: you will have to create multiple animations and string them together.

I chose $f(x)=x^2$ as my function, and my code is the following:

with(plots):

lt := display(seq($(plot(x^2, x = -3 .. 3, 0 .. 5, thickness = t), 10), t = 0 .. 3), insequence = true)

ls := display(seq($(plot(x^2, x = -3 .. 3, 0 .. 5, linestyle = t), 10), t = 0 .. 4), insequence = true)

display(lt, ls, insequence = true)

tlt := display(seq($(textplot([2, 1, convert(t, string)]), 10), t = 0 .. 3), insequence = true)

tls := display(seq($(textplot([2, 1, convert(t, string)]), 10), t = 0 .. 3), insequence = true)

> display(display(lt, ls, insequence = true), display(tlt, tls, insequence = true));

Does anybody have any idea why it isn't working?

P.S. The dollar signs are not supposed to be at that position in my code. For some reason when I copy + pasted my code they appeared on here. The dollar sign appears right after =t.

1

There are 1 best solutions below

0
On BEST ANSWER

Amongst other things, the values for t in your original creation of ls are taken from the numeric range 0..4. But that kind of numeric value will not be a valid linestyle.

Is this the kind of thing you are trying to do? (I've tried to keep to your approach... as it is your assignment.)

restart:
with(plots):

lt := seq(display(plot(x^2, x = -3 .. 3, 0 .. 5, thickness = t),
                  textplot([2, 1, convert(t, string)]))$3,
                  t = 1 .. 10):

display(lt, insequence = true);

ls := seq(display(plot(x^2, x = -3 .. 3, 0 .. 5, linestyle = t),
                  textplot([2, 1, convert(t, string)]))$10,
                  t = [dash,dashdot,longdash,solid,spacedash,spacedot]):

display(ls, insequence = true);

display(lt, ls, insequence = true);