新手,第一次发。
如果有帮助,求点赞。(狗头保命)
import turtle as t
#定义一个画太极的函数
def drawTaiji():
t.color("black","black")
t.begin_fill()
#填充阴鱼的颜色
t.penup()
t.goto(0,100)
t.seth(180)
t.pendown()
t.circle(50,180)
t.circle(-50,180)
t.seth(0)
t.circle(100,180)
t.end_fill()
t.circle(100,180)
#点阴鱼眼
t.penup()
t.goto(0,30)
t.pendown()
t.color("black","white")
t.begin_fill()
t.circle(20)
t.end_fill()
#点阳鱼眼
t.penup()
t.goto(0,-70)
t.pendown()
t.color("black","black")
t.begin_fill()
t.circle(20)
t.end_fill()
#隐藏那个画笔箭头
t.hideturtle()
#定义个画阴鱼的函数
def drawYinyu(x, y,z,r):
t.color("black","black")
t.begin_fill()
#填充阴鱼的颜色
t.penup()
t.goto(x,y)
t.seth(z)
t.pendown()
t.circle(r/2,180)
t.circle(-r/2,180)
t.seth(z-180)
t.circle(r,180)
t.end_fill()
#点阴鱼眼
t.penup()
t.left(90)
t.fd(r*0.7)
t.seth(z+180)
t.pendown()
t.color("black","white")
t.begin_fill()
t.circle(r/5)
t.end_fill()
#隐藏那个画笔箭头
t.hideturtle()
#定义个画阳鱼的函数
def drawYangyu(x, y,z,r):
t.color("black","white")
t.begin_fill()
#填充阳鱼的颜色
t.penup()
t.goto(x,y)
t.seth(z)
t.pendown()
t.circle(r/2,180)
t.circle(-r/2,180)
t.seth(z)
t.circle(-r,180)
t.end_fill()
#点阳鱼眼
t.penup()
t.left(270)
t.fd(r*1.7)
t.seth(z+180)
t.pendown()
t.color("black","black")
t.begin_fill()
t.circle(r/5)
t.end_fill()
#隐藏那个画笔箭头
t.hideturtle()
t.setup(1800,700,0,0)
t.bgcolor('black')
#drawTaiji()
'''
drawYinyu(20,100,180,100)
drawYangyu(-20,100,180,100)
drawYinyu(200,200)
drawYangyu(-200,200)
drawYinyu(-200,0)
drawYangyu(200,0)
'''
'''
for i in range(1,6):
drawYinyu(20,50,i*72,50)
#drawYangyu(-20,50,i*60)
#drawYinyu(0,50,360)
#drawYangyu(0,50,360)
'''
#画彩虹七边形作背景
t.speed(10)
t.penup()
t.goto(-350,0)
t.seth(0)
t.pendown()
c=['red','orange','yellow','green','cyan','blue','purple']
for x in range(235):
t.pencolor(c[x%7])
t.fd(x*2/7+x)
t.left(360/7+1)
t.width(x*7/200)
t.width(1)
t.penup()
t.goto(350,0)
t.seth(0)
t.pendown()
for x in range(235):
t.pencolor(c[x%7])
t.bk(x*2/7+x)
t.right(360/7+1)
t.width(x*7/200)
t.width(1)
'''
for i in range(1,7):
drawYangyu(0,0,i*60,150)
'''
#输入阴阳鱼的(x,y)坐标,z角度,r半径
drawYinyu(20,120,180,100)
drawYinyu(20,88,180,18)
drawYangyu(20,88,180,18)
drawYangyu(-20,80,180,100)
drawYinyu(-20,-52,180,18)
drawYangyu(-20,-52,180,18)
drawYinyu(0,-30,0,30)
drawYangyu(0,-30,0,30)
#加一点流动
i=1
while(i>0):
t.pencolor(c[i%7])
t.penup()
t.goto(0,-30)
t.seth(0)
t.pendown()
t.circle(15,180)
t.circle(-15,180)
t.seth(-180)
t.circle(30,180)
t.penup()
t.goto(0,-30)
t.seth(0)
t.pendown()
t.circle(15,180)
t.circle(-15,180)
t.seth(0)
t.circle(-30,180)
i=i+1