└── app.py /app.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | import math 3 | 4 | def xt(t): 5 | return 16 * math.sin(t) ** 3 6 | def yt(t): 7 | return 13 * math.cos(t) - 5 \ 8 | * math.cos(2 * t) - 2 * \ 9 | math.cos(3 * t) - math.cos(4 * t) 10 | t = turtle.Turtle() 11 | t.speed(500) 12 | turtle.colormode(255) 13 | turtle.Screen().bgcolor(0,0,0) 14 | for i in range(2550): 15 | t.goto((xt(i) * 20, yt(i) * 20)) 16 | t.pencolor((255 - i) % 255, i % 255 , (255 + i ) % 255) 17 | t.goto(0,0) 18 | t.hideturtle() 19 | 20 | turtle.update() 21 | turtle.mainloop() --------------------------------------------------------------------------------