import math import turtle def drawx(k): return 15 * math.sin(k) ** 3 def drawy(k): return 12 * math.cos(k) - 5 * math.cos(2 * k) - 2 * math.cos(3 * k) - math.cos(4 * k) turtle.setup(1.0, 1.0) turtle.title('爱心射线') turtle.bgcolor('black') t = turtle.Turtle() t.screen.delay(0) t.hideturtle() for i in range(6000): t.goto(drawx(i) * 20, drawy(i) * 20) for j in range(5): t.color('pink') t.goto(0, 0) turtle.done()