File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Draws a hat aperiodic monotile.
4+ . DESCRIPTION
5+ This function uses turtle graphics to draw an aperiodic monotile called a "Hat"
6+ . EXAMPLE
7+ turtle rotate -90 hatMonotile 100 save ./hatMonotile.svg
8+ . LINK
9+ https://github.com/christianp/aperiodic-monotile/blob/main/hat-monotile.logo
10+ #>
11+ param (
12+ [double ]
13+ $A = 100 ,
14+
15+ [double ]
16+ $B = 0
17+ )
18+
19+ if (-not $B ) {
20+ $B = [Math ]::Tan(60 * [Math ]::PI / 180 ) * $A
21+ }
22+
23+
24+ return $this .
25+ Forward($b ).
26+ Rotate(90 ).
27+ Forward($a ).
28+ Left(60 ).
29+ Forward($a ).
30+ Rotate(90 ).
31+ Forward($b ).
32+ Rotate(60 ).
33+ Forward($b ).
34+ Left(90 ).
35+ Forward($a ).
36+ Rotate(60 ).
37+ Forward($a ).
38+ Rotate(90 ).
39+ Forward($b ).
40+ Rotate(60 ).
41+ Forward($b ).
42+ Left(90 ).
43+ Forward($a ).
44+ Rotate(60 ).
45+ Forward($a ).
46+ Forward($a ).
47+ Rotate(60 ).
48+ Forward($a ).
49+ Rotate(90 ).
50+ Forward($b ).
51+ Left(60 )
You can’t perform that action at this time.
0 commit comments