赞
踩
python 绘制太极
import turtle
pen = turtle.Turtle()
print("开始绘制太极")
radius = 100
pen.color("black", "black")
pen.begin_fill()
pen.circle(radius/2, 180)
pen.circle(radius, 180)
pen.left(180)
pen.circle(-radius/2, 180)
pen.end_fill()
pen.left(90)
pen.pu()
pen.fd(radius*0.35)
pen.right(90)
pen.pd()
print("绘制小圆")
pen.color("white", "white")
pen.begin_fill()
pen.circle(radius*0.15)
pen.end_fill()
pen.left(90)
pen.up()
pen.backward(radius*0.7)
pen.down()
pen.left(90)
print("绘制小圆")
pen.color("black", "black")
pen.begin_fill()
pen.circle(radius*0.15)
pen.end_fill()
print("补大圆")
pen.right(90)
pen.pu()
pen.backward(radius*0.65)
pen.right(90)
pen.pd()
pen.circle(radius, 180)
print("绘制完成")
pen.ht()
turtle.done()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。