Skip to content

Commit a8f7647

Browse files
feat: Turtle.FlowerPetal ( Fixes #124 )
1 parent b5344ea commit a8f7647

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Types/Turtle/FlowerPetal.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<#
2+
.SYNOPSIS
3+
Draws a flower made of petals
4+
.DESCRIPTION
5+
Draws a flower made of a series of petals.
6+
7+
Each petal is a combination of two arcs and rotations.
8+
.EXAMPLE
9+
turtle FlowerPetal 60
10+
#>
11+
param(
12+
# The radius of the flower
13+
[double]
14+
$Radius = 10,
15+
16+
# The rotation per step
17+
[double]
18+
$Rotation = 30,
19+
20+
# The angle of the petal.
21+
[double]
22+
$PetalAngle = 60,
23+
24+
# The number of steps.
25+
[ValidateRange(1,1mb)]
26+
[int]
27+
$StepCount = 12
28+
)
29+
30+
foreach ($n in 1..$stepCount) {
31+
$this = $this.Petal($radius, $PetalAngle).Rotate($Rotation)
32+
}
33+
34+
return $this

0 commit comments

Comments
 (0)