Skip to content

Commit 1b82ad8

Browse files
feat: Turtle.LevyCurve() ( Fixes #155 )
1 parent e134391 commit 1b82ad8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Types/Turtle/LevyCurve.ps1

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

0 commit comments

Comments
 (0)