From: Jeong Dal <haksan@me.com>
To: ntg-context@ntg.nl
Subject: animation using \startuseMPgraphic
Date: Sun, 19 Apr 2020 14:08:46 +0900 [thread overview]
Message-ID: <15AC49E5-BC89-4C19-A68E-E556DD202D3B@me.com> (raw)
In-Reply-To: <mailman.1.1587204001.32518.ntg-context@ntg.nl>
[-- Attachment #1.1: Type: text/plain, Size: 1315 bytes --]
Dear all,
I am trying to make an animation using the animation module.
But it draws 10 figures instead of creating animation.
Is there anything I have to do more?
Or, is there a better way to do this?
Thank you for reading.
Best regards,
Dalyoung
\startuseMPgraphic{inversionPoint}{n}
vardef findPointD(expr C, Q, r) =
numeric dist, ang;
pair X, Y;
dist := r**2/sqrt((xpart Q - xpart C)**2 + (ypart Q - ypart C)**2);
ang := angle(Q - C);
Y := C + dir(ang)*dist;
Y
enddef;
numeric radius, now, move;
pair A,B,C,P,Q;
path p,q;
radius := 2cm;
C := origin;
p := fullcircle scaled (2*radius);
z[1] = point 6 of p;
z[2] = point .8 of p;
q := (1.5*z1 - .5*z2) -- (-.5z1 + 1.5*z2);
%q := fullcircle scaled radius shifted (2cm, 1cm);
draw p;
draw q;
%for i := 0 step 0.1 until 1:
move := 0.1;
now := move*\MPvar{n};
P := point now along q;
Q := findPointD(C, P, radius);
drawdot P;
drawdot Q withcolor .625red;
dotlabel.lft(textext("P"),P);
dotlabel.rt(textext("Q"),Q) withcolor .625red;
%endfor;
\stopuseMPgraphic
\usemodule[animation]
\setupinteraction[state=start]
\starttext
%\startplacefigure[]
\startanimation[menu=yes]
\dorecurse{10}{
\useMPgraphic{inversionPoint}{n=\recurselevel}
}
\stopanimation
%\stopplacefigure
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 12040 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
___________________________________________________________________________________
next parent reply other threads:[~2020-04-19 5:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1.1587204001.32518.ntg-context@ntg.nl>
2020-04-19 5:08 ` Jeong Dal [this message]
2020-04-19 7:19 ` Wolfgang Schuster
2020-04-19 11:18 ` Jeong Dal
2020-04-19 19:02 ` Jeong Dal
2020-04-19 20:57 ` Hans Hagen
2020-04-19 22:49 ` Jeong Dal
2020-04-19 16:32 ` Aditya Mahajan
[not found] <mailman.166.1587373273.1194.ntg-context@ntg.nl>
2020-04-20 14:40 ` Jeong Dal
2020-04-20 17:19 ` Hans Hagen
2020-04-21 11:10 ` Jeong Dal
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=15AC49E5-BC89-4C19-A68E-E556DD202D3B@me.com \
--to=haksan@me.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).