summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples/clockarray.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-25 19:22:25 +0000
committerKarl Berry <karl@freefriends.org>2021-02-25 19:22:25 +0000
commitad547a6b5986815fda458221149728d9d9ab1d87 (patch)
tree16296910eb3eca724371474ea9aea3994dc69614 /Build/source/utils/asymptote/examples/clockarray.asy
parent947b43de3dd21d58ccc2ffadefc4441ea1c2a813 (diff)
restore Build,TODO from r57911
git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/examples/clockarray.asy')
-rw-r--r--Build/source/utils/asymptote/examples/clockarray.asy39
1 files changed, 39 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/examples/clockarray.asy b/Build/source/utils/asymptote/examples/clockarray.asy
new file mode 100644
index 00000000000..be7fd899a0e
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/clockarray.asy
@@ -0,0 +1,39 @@
+int nx=3;
+int ny=4;
+real xmargin=1cm;
+real ymargin=xmargin;
+
+size(settings.paperwidth,settings.paperheight);
+
+picture pic;
+real width=settings.paperwidth/nx-xmargin;
+real height=settings.paperheight/ny-ymargin;
+if(width <= 0 || height <= 0) abort("margin too big");
+size(pic,width,height);
+
+pen p=linewidth(0.5mm);
+draw(pic,unitcircle,p);
+
+real h=0.08;
+real m=0.05;
+
+for(int hour=1; hour <= 12; ++hour) {
+ pair z=dir((12-hour+3)*30);
+ label(pic,string(hour),z,z);
+ draw(pic,z--(1-h)*z,p);
+}
+
+for(int minutes=0; minutes < 60; ++minutes) {
+ pair z=dir(6*minutes);
+ draw(pic,z--(1-m)*z);
+}
+
+dot(pic,(0,0));
+
+frame f=pic.fit();
+pair size=size(f)+(xmargin,ymargin);
+
+for(int i=0; i < nx; ++i)
+ for(int j=0; j < ny; ++j)
+ add(shift(realmult(size,(i,j)))*f);
+