Le 21 juill. 2021 à 10:08, Jeroen <contextntg@gmail.com> a écrit :I use this small animation to enlarge a circle
\usemodule[animation]
\setupinteraction[state=start]
\starttext
\startanimation[menu=yes,framerate=10]
\dorecurse{7}{\expanded
{\startframe
\startMPcode
path p;
numeric n, u;
u := 1cm;
n:=\recurselevel*u;
p := fullcircle scaled n;
draw p;
\stopMPcode
\stopframe}}
\stopanimation
\stoptext
This I use to draw a sine
\starttext
\startMPcode
draw(-90/360*1.5cm,-0.9cm) for i = -90 upto 630: .. (i/360*1.5cm,0.9cm*(sind(i)))endfor;
\stopMPcode
\stoptext
When I put it together to animate the sine as following, it does not entirely create the sine animation I am looking for
\usemodule[animation]
\setupinteraction[state=start]
\starttext
\startanimation[menu=yes,framerate=10]
\dorecurse{7}{\expanded
{\startframe
\startMPcode
path p;
numeric n, u;
u := 1cm;
n:=\recurselevel*u;
p := (-90/360*1.5cm,-0.9cm) for i = -90 upto 630: .. (i/360*1.5cm,0.9cm*(sind(i))) endfor shifted (n,0);
draw p;
\stopMPcode
\stopframe}}
\stopanimation
\stoptext
What better way can I create a sine animation with Metapost?