summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples/clockarray.asy
diff options
context:
space:
mode:
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);
+