# Draw the GKMS aperiodic tile
[tag:code-golf][tag:graphical-output][tag:geometry][tag:tiling]

Chaim Goodman-Strauss, Craig Kaplan, Joseph Myers and David Smith [found](https://cs.uwaterloo.ca/~csk/hat) the following simple (both [objectively](https://en.wikipedia.org/wiki/Simple_polygon) and subjectively) polygon that tiles the plane, but only aperiodically:

![](https://i.sstatic.net/y926j.png)

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:

![](https://i.sstatic.net/hsp4K.png)

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 [tag:code-golf]; fewest bytes wins.

## Test cases

|\$p\$|\$T(p)\$|
|-|-|
|0|![](https://i.sstatic.net/Z2Mg5.png)|
|\$\frac1{\sqrt3+1}=\$<br/>0.36602540378443865|![](https://i.sstatic.net/5QONh.png)|
|0.5|![](https://i.sstatic.net/98syP.png)|
|\$\frac{\sqrt3}{\sqrt3+1}=\$<br/>0.6339745962155613|![](https://i.sstatic.net/L4lkG.png)|
|1|![](https://i.sstatic.net/7NajS.png)|