中心对称(旋转对称) 15.3
Python
def rotational_symmetry(petals, radius, color):
"""绘制旋转对称图案"""
t.penup()
t.goto(0, -radius)
t.pendown()
t.pencolor(color)
angle = 360 / petals
for i in range(petals):
t.circle(radius)
t.right(angle)
# 清除画布并测试
t.clear()
rotational_symmetry(8, 50, "yellow")