from turtle import *
from math import *
def draw(a, n, end):
t = 0
pendown()
while t <= end:
x = a * sin(n * t) * cos(t)
y = a * sin(n * t) * sin(t)
goto(x, y)
t = t + 0.01
penup()
if __name__ == '__main__':
setup(800, 800)
bgcolor('white')
pencolor('black')
speed(0)
'''三叶玫瑰'''
# draw(100, 3, 3.14)
'''五叶玫瑰'''
draw(100, 5, 3.14)
'''六叶玫瑰'''
# draw(200, 1.5, 12.56)
done()
python绘制玫瑰线
最新推荐文章于 2024-07-06 16:25:50 发布