summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples/animations/wheel.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/examples/animations/wheel.asy')
-rw-r--r--Build/source/utils/asymptote/examples/animations/wheel.asy16
1 files changed, 13 insertions, 3 deletions
diff --git a/Build/source/utils/asymptote/examples/animations/wheel.asy b/Build/source/utils/asymptote/examples/animations/wheel.asy
index 2ea45f75613..6620d590850 100644
--- a/Build/source/utils/asymptote/examples/animations/wheel.asy
+++ b/Build/source/utils/asymptote/examples/animations/wheel.asy
@@ -1,4 +1,9 @@
import graph;
+
+// Uncomment the following 2 lines to support pdf animations:
+// usepackage("animate");
+// settings.tex="pdflatex";
+
import animation;
size(0,200);
@@ -24,6 +29,8 @@ guide wheel(guide g=nullpath, real a, real b, int n)
real t1=0;
real t2=t1+2*pi;
+animation a;
+
draw(circle((0,0),1));
draw(wheel(t1,t2,100),linetype("0 2"));
yequals(Label("$y=-1$",1.0),-1,extend=true,linetype("4 4"));
@@ -34,8 +41,6 @@ pair z2=wheelpoint(t2);
dot(z1);
dot(z2);
-animation a;
-
int n=10;
real dt=(t2-t1)/n;
for(int i=0; i <= n; ++i) {
@@ -49,5 +54,10 @@ for(int i=0; i <= n; ++i) {
restore();
}
-// Produce the final merged gif.
+erase();
+
+// Merge the images into a gif animation.
a.movie(BBox(0.25cm),loops=10,delay=250);
+
+// Merge the images into a pdf animation.
+// label(a.pdf(BBox(0.25cm),delay=250,"controls",multipage=false));