File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ <#
2
+ . SYNOPSIS
3
+ Draws a turtle aperiodic monotile.
4
+ . DESCRIPTION
5
+ This function uses turtle graphics to draw an aperiodic monotile called a "Turtle"
6
+ . EXAMPLE
7
+ turtle rotate -90 turtleMonotile 100 save ./turtleMonotile.svg
8
+ . LINK
9
+ https://github.com/christianp/aperiodic-monotile/blob/main/turtle-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
+ return $this .
24
+ Rotate(90 ).
25
+ Forward($a ).
26
+ Rotate(60 ).
27
+ Forward($a ).
28
+ Rotate(-90 ).
29
+ Forward($b ).
30
+ Rotate(60 ).
31
+ Forward($b ).
32
+ Forward($b ).
33
+ Rotate(60 ).
34
+ Forward($b ).
35
+ Rotate(90 ).
36
+ Forward($a ).
37
+ Rotate(-60 ).
38
+ Forward($a ).
39
+ Rotate(90 ).
40
+ Forward($b ).
41
+ Rotate(-60 ).
42
+ Forward($b ).
43
+ Rotate(90 ).
44
+ Forward($a ).
45
+ Rotate(60 ).
46
+ Forward($a ).
47
+ Rotate(-90 ).
48
+ Forward($b ).
49
+ Rotate(60 ).
50
+ Forward($b )
51
+
52
+ return
53
+
54
+
You can’t perform that action at this time.
0 commit comments