From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106938 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jeong Dal Newsgroups: gmane.comp.tex.context Subject: Re: animation using \startuseMPgraphic Date: Mon, 20 Apr 2020 04:02:19 +0900 Message-ID: References: <15AC49E5-BC89-4C19-A68E-E556DD202D3B@me.com> <256408a3-4762-4b2d-5122-dfde363b6080@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: multipart/mixed; boundary="===============0079900694007568623==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74148"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mailing list for ConTeXt users To: Wolfgang Schuster Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 19 21:02:42 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQFDG-000J8v-Fu for gctc-ntg-context-518@m.gmane-mx.org; Sun, 19 Apr 2020 21:02:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 23516183358; Sun, 19 Apr 2020 21:02:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ncnzRkanPDud; Sun, 19 Apr 2020 21:02:28 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 35007183336; Sun, 19 Apr 2020 21:02:28 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A0307183336 for ; Sun, 19 Apr 2020 21:02:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o--PxhiJvUww for ; Sun, 19 Apr 2020 21:02:26 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=17.58.6.43; helo=pv50p00im-hyfv10011601.me.com; envelope-from=haksan@me.com; receiver= Original-Received: from pv50p00im-hyfv10011601.me.com (pv50p00im-hyfv10011601.me.com [17.58.6.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B9486182D57 for ; Sun, 19 Apr 2020 21:02:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1587322943; bh=sSlnPF/9HYKngQPEzya6poU0EpyZ969Pf2j0OVqkODo=; h=From:Message-Id:Content-Type:Subject:Date:To; b=VyXxJiBD3f86xfhnIZ8QlR3oZVc9bKadepweV6g0jXtKNnQottp4ZakEao7tZuE5Z NWzZ172/NqIIC06lgmKEpvDSbwPefY/MqyPCLaOVW3+S2Lq1222x/EyNjbLLO2zRD7 Zz2eHbIeIpZpAhefnc7JKaNeCpBMde7PEAHGYC0zGsWr/Hqlzoopi1xpFVVXWYFUcj xPBc0BtsTE+P4HTvT6nZXk4RAQJqhSsqiQIWwOe1zj8de5TkVsMARARDfLj9tkT03c KdDmuOG5d22Q7laZtAlA2gZ8Zgtv5osu2UUQTX5bXCNjLKdrZDI1fCyaxHhWqeTctW stXUthH+duG1w== Original-Received: from [10.0.1.6] (unknown [222.232.154.22]) by pv50p00im-hyfv10011601.me.com (Postfix) with ESMTPSA id 972BB3800AB; Sun, 19 Apr 2020 19:02:22 +0000 (UTC) In-Reply-To: X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-19_05:2020-04-17, 2020-04-19 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=879 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2002250000 definitions=main-2004190165 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:106938 Archived-At: --===============0079900694007568623== Content-Type: multipart/alternative; boundary="Apple-Mail=_F2040F27-3974-49B3-9140-F881EC40CEA6" --Apple-Mail=_F2040F27-3974-49B3-9140-F881EC40CEA6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Wolfgang, I=E2=80=99d like to ask you one more. To make an animation, almost same graphics are drawn repeatedly. In my code, for example, The base figure(two circles, line, boundingbox) is fixed and only points = are moved. But it draws the base figure every time and it is not inefficient. Is there a way to draw the base figure once, and draw the points only at = each frame? Thank you. Best regards, Dalyoung \startuseMPgraphic{inversionPoint}{n} vardef findPointD(expr C, Q, r) =3D=20 numeric dist, ang; pair X, Y; dist :=3D r**2/sqrt((xpart Q - xpart C)**2 + (ypart Q - ypart = C)**2); ang :=3D angle(Q - C); Y :=3D C + dir(ang)*dist; Y enddef; numeric radius, now, move; pair A,B,C,P,Q; path p,q; radius :=3D 2cm; C :=3D origin; p :=3D fullcircle scaled (2*radius); z[1] =3D point 6 of p; z[2] =3D point .8 of p; q :=3D (1.5*z1 - .5*z2) -- (-.5z1 + 1.5*z2); %q :=3D fullcircle scaled radius shifted (2cm, 1cm); draw p; draw q;=20 % end of base figure % draw points move :=3D 0.1; now :=3D move*\MPvar{n}; P :=3D point now along q; Q :=3D findPointD(C, P, radius); drawdot P; drawdot Q withcolor .625red; dotlabel.lft(textext("P"),P); dotlabel.rt(textext("Q"),Q) withcolor .625red; \stopuseMPgraphic --Apple-Mail=_F2040F27-3974-49B3-9140-F881EC40CEA6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = Wolfgang,

I=E2=80=99d = like to ask you one more.

To make an animation, almost same graphics are drawn = repeatedly.
In my code, for example,
The base figure(two circles, line, boundingbox) is fixed and = only points are moved.
But it draws the base figure = every time and it is not inefficient.

Is there a way to draw the base figure = once, and draw the points only at each frame?

Thank you.
Best = regards,

Dalyoung

\startuseMPgraphic{inversionPoint}{n}
vardef findPointD(expr C, Q, = r) =3D
numeric dist, ang;
pair X, Y;
dist :=3D r**2/sqrt((xpart Q - xpart C)**2 + (ypart Q - ypart C)**2);
ang :=3D angle(Q - C);
Y :=3D C + dir(ang)*dist;
Y
enddef;

numeric radius, now, move;
pair = A,B,C,P,Q;
path p,q;
radius :=3D 2cm;
C :=3D origin;
p :=3D fullcircle = scaled (2*radius);
z[1] =3D point 6 of p;
z[2] =3D point .8 of p;

q :=3D (1.5*z1 - .5*z2) -- (-.5z1 + 1.5*z2);
%q :=3D fullcircle scaled radius shifted (2cm, = 1cm);
draw p;
draw q;

% end of base figure
% draw points

move :=3D 0.1;
now :=3D move*\MPvar{n};
P :=3D point now = along q;
Q :=3D findPointD(C, P, radius);
drawdot P;
drawdot Q = withcolor .625red;
dotlabel.lft(textext("P"),P);
dotlabel.rt(textext("Q"),Q) withcolor .625red;
\stopuseMPgraphic

= --Apple-Mail=_F2040F27-3974-49B3-9140-F881EC40CEA6-- --===============0079900694007568623== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============0079900694007568623==--