ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jeroen <contextntg@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Metapost Animation of Sine
Date: Wed, 21 Jul 2021 19:44:36 +0200	[thread overview]
Message-ID: <CAPtmdbM_REn+UK85T7zw-1cBBd8+tuNpp=gx364q8xOh6z7-xA@mail.gmail.com> (raw)
In-Reply-To: <92E16120-1E0D-4EFF-89EA-1AF088952048@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2656 bytes --]

I am looking for a sine animation as the one file f.pdf on this site

http://www.12000.org/my_notes/Mathematica_animation_into_PDF_using_latex/index.htm

Jeroen

Op wo 21 jul. 2021 om 17:54 schreef Fabrice L <fabrice.alpha@gmail.com>:

> Hi,
>
> 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?
>
>
>
>
> Here is another way to do your animation. This is doing something, but I
> guess not what you want. Could you describe what do you have in mind ?
>
> \starttext
> \dorecurse{7}{ % 3180
> \startMPpage
> myvariable := #1 ;
> path p;
>     numeric n, u;
>     u := 1cm;
>     n:=myvariable*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;
> \stopMPpage
> }
> \stoptext
>
> Fabrice.
>
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 4490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-07-21 17:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 14:08 Jeroen
2021-07-21 15:54 ` Fabrice L
2021-07-21 17:44   ` Jeroen [this message]
2021-07-21 21:26     ` Otared Kavian
2021-07-22 12:28       ` Jeroen
2021-07-22 20:38         ` Otared Kavian
2021-07-21 21:45     ` Otared Kavian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPtmdbM_REn+UK85T7zw-1cBBd8+tuNpp=gx364q8xOh6z7-xA@mail.gmail.com' \
    --to=contextntg@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).