下方为简单的红心源码,笛卡尔心形曲线待研究引用。
import turtle as t
t.bgcolor(0.7,0.7,0.7)#背景色
t.setup(500,500,50,50)
t.penup()
t.goto(0,-100)
t.pendown()
t.pensize(2)
t.color('red')
t.begin_fill()
#t.seth(10)
t.circle(100,90)
t.seth(90)
t.circle(50,180)
t.penup()
t.goto(0,-100)
t.pendown()
t.pensize(2)
t.seth(0)
t.circle(100,-90)
t.seth(-90)
t.circle(50,-180)
t.seth(180)
t.end_fill()
t.done()
下方为效果图
网友评论