Skip to content

Commit 999ca38

Browse files
feat: Turtle.Pentaplexity ( Fixes #146 )
1 parent b6986f7 commit 999ca38

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Types/Turtle/Pentaplexity.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<#
2+
.SYNOPSIS
3+
Draws a Pentaplexity
4+
.DESCRIPTION
5+
Draws a Pentaplexity Fractal, using an L-System
6+
.LINK
7+
https://paulbourke.net/fractals/lsys/
8+
.EXAMPLE
9+
turtle Pentaplexity 42 1
10+
.EXAMPLE
11+
turtle Pentaplexity 42 2
12+
.EXAMPLE
13+
turtle Pentaplexity 42 3
14+
.EXAMPLE
15+
turtle Pentaplexity 42 4
16+
#>
17+
param(
18+
# The size of each segment
19+
[double]$Size = 200,
20+
# The order of magnitude (the number of expansions)
21+
[int]$Order = 4,
22+
# The default angle.
23+
[double]$Angle = 36
24+
)
25+
return $this.LSystem('F++F++F++F++F', [Ordered]@{
26+
F = 'F++F++F+++++F-F++F'
27+
}, $Order, [Ordered]@{
28+
'\+' = { $this.Rotate($Angle) }
29+
'-' = { $this.Rotate($Angle*-1)}
30+
'F' = { $this.Forward($Size) }
31+
})

0 commit comments

Comments
 (0)