Hong-Phuc Bui
2024-05-12 6609420bf03972212cbfaeb6b53eee66a478e7bf
python-grundlage/petal.py
@@ -2,18 +2,18 @@
import turtle
import math
num_of_petal = 60
num_of_petal = 5
petal_length = 100
# winkel sind in Degree
alpha = 90 / num_of_petal
alpha = 90 / (num_of_petal-1)
beta = 2 * alpha
gamma = 180 - beta
# abgeleitete Länge
side_length = petal_length * math.cos(math.radians(alpha))
start_angle = 0
for petal in range(0, num_of_petal):
    direction = petal * (360 / num_of_petal)
    direction = petal * (360 / num_of_petal) + start_angle
    turtle.home()
    turtle.left(direction + alpha)
    turtle.fd(side_length)