Skip to content

Commit 047c394

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.TurtleMonotile ( Fixes #195 )
1 parent a6bba72 commit 047c394

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

Turtle.types.ps1xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,66 @@ return $this.LSystem('F++F++F', [Ordered]@{
24242424
'F' = { $this.Forward($Size) }
24252425
})
24262426

2427+
</Script>
2428+
</ScriptMethod>
2429+
<ScriptMethod>
2430+
<Name>TurtleMonotile</Name>
2431+
<Script>
2432+
&lt;#
2433+
.SYNOPSIS
2434+
Draws a turtle aperiodic monotile.
2435+
.DESCRIPTION
2436+
This function uses turtle graphics to draw an aperiodic monotile called a "Turtle"
2437+
.EXAMPLE
2438+
turtle rotate -90 turtleMonotile 100 save ./turtleMonotile.svg
2439+
.LINK
2440+
https://github.com/christianp/aperiodic-monotile/blob/main/turtle-monotile.logo
2441+
#&gt;
2442+
param(
2443+
[double]
2444+
$A = 100,
2445+
2446+
[double]
2447+
$B = 0
2448+
)
2449+
2450+
if (-not $B) {
2451+
$B = [Math]::Tan(60 * [Math]::PI / 180) * $A
2452+
}
2453+
2454+
return $this.
2455+
Rotate(90).
2456+
Forward($a).
2457+
Rotate(60).
2458+
Forward($a).
2459+
Rotate(-90).
2460+
Forward($b).
2461+
Rotate(60).
2462+
Forward($b).
2463+
Forward($b).
2464+
Rotate(60).
2465+
Forward($b).
2466+
Rotate(90).
2467+
Forward($a).
2468+
Rotate(-60).
2469+
Forward($a).
2470+
Rotate(90).
2471+
Forward($b).
2472+
Rotate(-60).
2473+
Forward($b).
2474+
Rotate(90).
2475+
Forward($a).
2476+
Rotate(60).
2477+
Forward($a).
2478+
Rotate(-90).
2479+
Forward($b).
2480+
Rotate(60).
2481+
Forward($b)
2482+
2483+
return
2484+
2485+
2486+
24272487
</Script>
24282488
</ScriptMethod>
24292489
<ScriptMethod>

0 commit comments

Comments
 (0)