中心对称(旋转对称) 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")

您可能还喜欢...

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注