Quantcast
Viewing all articles
Browse latest Browse all 35

Draw the GKMS aperiodic tile

Chaim Goodman-Strauss, Craig Kaplan, Joseph Myers and David Smith found the following simple (both objectively and subjectively) polygon that tiles the plane, but only aperiodically:

Image may be NSFW.
Clik here to view.

Indeed they found a one-parameter family of such aperiodic monotiles or "einsteins". The edges of all tiles in this family meet at 90° or 120° and are made out of two distinct lengths:

Image may be NSFW.
Clik here to view.

Let \$a\$ and \$b\$ be nonnegative real numbers and define the following turtle graphics commands:

  • \$A,B\$: move forwards by \$a\$ or \$b\$ respectively (blue and purple edges in the image above)
  • \$L,R\$: turn left or right by 90° respectively
  • \$S,T\$: turn left or right by 60° respectively

Then the aperiodic tile \$T(a,b)\$ associated with \$a\$ and \$b\$ is traced by the command sequence$$ASAR\ BSBR\ ATAL\ BTBR\ ATAL\ BTBBTBR$$It is clear that \$T(a,b)\$ is similar to \$T(ka,kb)\$ for any scaling constant \$k\$, so we can reduce the number of parameters to one by defining $$T(p)=T(p,1-p)\qquad0\le p\le1$$The tile in this challenge's first picture – the "hat" of the GKMS paper – is \$T\left(\frac{\sqrt3}{\sqrt3+1}\right)\$. \$T(0)\$, \$T(1)\$ and \$T(1/2)\$ admit periodic tilings, but the first two of these exceptions are polyiamonds and play a central role in the proof that \$T(p)\$ for all other \$p\in[0,1]\$ is aperiodic.

Task

Given a real number \$p\$ satisfying \$0\le p\le1\$, draw \$T(p)\$ as defined above.

  • The image can be saved to a file or piped raw to stdout in any common image file format, or it can be displayed in a window.
  • The polygon may be drawn in any orientation and may be flipped from the schematic above (though of course the aspect ratio must not be changed). It may be filled with any colour or pattern and may optionally be outlined with any colour, but the polygon's boundary must be clear.
  • Raster images must be at least 400 pixels wide, and an error of 2 pixels/1% is allowed.

This is ; fewest bytes wins.

Test cases

\$p\$\$T(p)\$
0Image may be NSFW.
Clik here to view.
0.2Image may be NSFW.
Clik here to view.
\$\frac1{\sqrt3+1}=\$
0.36602540378443865
Image may be NSFW.
Clik here to view.
0.5Image may be NSFW.
Clik here to view.
\$\frac{\sqrt3}{\sqrt3+1}=\$
0.6339745962155613
Image may be NSFW.
Clik here to view.
0.8Image may be NSFW.
Clik here to view.
1Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>