用python的turtle库画一个写轮眼(血轮眼)

如下

from math import *
from turtle import *
home()
speed(0)
r=260#大小 圆设置
x=2
screensize(400,300,"black")
y=x*r
z=sqrt(pow(r,2)+pow(y,2))
w=40
pu()
right(90)
fd(240)
left(90)
pd()
fillcolor("red")
begin_fill()
circle(r)
end_fill()

pu()
left(90)
fd(r)
#复位中心上键
#print(pos())(显示坐标)
speed(0)
width(7)
for i in range(6):
    right(60+90)#六边
    fd(y)
    right(90)
    fd(z)
    left(90)
    pd()
    circle(z)
    pu()
    #取线
    left(90)
    fd(z)
    left(90)
    fd(y)
    right(90)
fd(w)
#内小圆
left(90)
pd()
fillcolor("red")#内小圆颜色
begin_fill()
print(pos())
circle(w)
end_fill()
#circle(w)
left(90)
pu()
fd(w)
left(90)
fd(39)
pd()
fillcolor("black")
begin_fill()
goto(0,220)
goto(-40,20)
pu()
goto(20,20*sqrt(3)+20)
end_fill()
pd()
fillcolor("black")
begin_fill()
goto(100*sqrt(3),-80)
goto(-20,20-20*sqrt(3))
pu()
goto(20,20-20*sqrt(3))
end_fill()
pd()
fillcolor("black")
begin_fill()
goto(-100*sqrt(3),-80)
goto(-20,20*sqrt(3)+20)
pu()
goto(0,20)
end_fill()
goto(0,60)
right(180)
fillcolor("red")#内小圆颜色
begin_fill()
print(pos())
circle(w)
end_fill()
hideturtle()#隐藏海龟
#新赤

exitonclick()

  • 7
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值