Dr. Blake Martin

120 Reputation

6 Badges

6 years, 49 days
Senior Developer

MaplePrimes Activity

These are answers submitted by bmartin


If you absolutely wanted to add a small arrow you can do so by overlaying a polygon on your plot. The polygon will use 3 points to draw the arrow. Here is one way of getting this done, which could be extended to include multiple arrows.



f := [sin(t), cos(t)];

[sin(t), cos(t)]


plt := plot([op(f), t=0..Pi]):
poly := PLOT(POLYGONS([[-0.025,0.05],[-0.025,-0.05],[0.025,0]])):

t0 := Pi/3;



        plottools:-rotate(poly, arctan(op(ListTools:-Reverse(subs(t=t0, diff(f,t)))))),
    op(subs(t=t0, f)))
, scaling=constrained)



In the code, if you change the sign in f to be -cos(t), you will see that the arrow will change directions as expected.




If you which to generalize the problem to 3D motion, you will want to consider a spherical pendulum since you need to consider more than just a single angle to describe the position of the pendulum. Here is a Wiki page that can serve as a reference for a spherical pendulum:

Once you have the equations of motion, you can follow a similar approach to what is found in the Maple worksheet in the link you provided.


Is the main problem plotting multiple lines simultaneously? If so, the easiest way to display multiple plots simultaneously is to use the 'display' command in the 'plots' package. This allows you to define a list of plot structures and have them plotted on the same figure. To define multiple plots quickly you can take advantage of the 'seq' command.

As a simple example, here are three sine waves plotted simultaneously with different frequencies.

plots:-display([seq(plot(sin(x*a), x=-Pi..Pi), a=1..3)]);

Hope this helps!


In the sort command there is an option to output the permutation that would sort the list in the desired order. You can get the list you want by calling:

sort([8,7,9,12], `>`, output=permutation);

The option `>` is also given to the sort command since you want to find the permutation that will give you a list from largest to smallest value.


- Blake Martin

1 2 Page 2 of 2