Skip to content

Commit 9dc7d14

Browse files
feat: Turtle.Petal ( Fixes #119 )
1 parent 03ebafe commit 9dc7d14

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Types/Turtle/Petal.ps1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<#
2+
.SYNOPSIS
3+
Draws a petal
4+
.DESCRIPTION
5+
Draws a petal.
6+
7+
This is a combination of two arcs and rotations.
8+
.EXAMPLE
9+
turtle @('petal',100,60, 'rotate', 60 * 6)
10+
#>
11+
param(
12+
[double]
13+
$Radius = 10,
14+
15+
[double]
16+
$Angle = 60
17+
)
18+
19+
$OppositeAngle = 180 - $Angle
20+
21+
22+
$null = @(
23+
$this.ArcRight($Radius, $angle)
24+
$this.Rotate($OppositeAngle)
25+
$this.ArcRight($Radius, $angle)
26+
$this.Rotate($OppositeAngle)
27+
)
28+
29+
return $this

0 commit comments

Comments
 (0)