首页 > 其他分享 >绘制风轮

绘制风轮

时间:2022-10-14 22:45:09浏览次数:51  
标签:顺时针 风轮 旋转 180 right 90 绘制 fill

image

import turtle as t
t.begin_fill()

t.fillcolor("red")
t.seth(0)  #改变方向朝向0°
t.forward(180)
t.right(90) #方向顺时针旋转90°
t.circle(-100,45) #顺时针为-,逆时针为+,后面是长度,第二个参数为旋转角度。
t.right(90)
t.goto(0,0)

t.end_fill()

t.begin_fill()
t.fillcolor("yellow")

t.seth(90)  #改变方向朝向0°
t.forward(180)
t.right(90) #方向顺时针旋转90°
t.circle(-100,45) #顺时针为-,逆时针为+,后面是长度,第二个参数为旋转角度。
t.right(90)
t.goto(0,0)

t.end_fill()

t.begin_fill()
t.fillcolor("green")

t.seth(180)  #改变方向朝向0°
t.forward(180)
t.right(90) #方向顺时针旋转90°
t.circle(-100,45) #顺时针为-,逆时针为+,后面是长度,第二个参数为旋转角度。
t.right(90)
t.goto(0,0)

t.end_fill()

t.begin_fill()
t.fillcolor("blue")

t.seth(270)  #改变方向朝向0°
t.forward(180)
t.right(90) #方向顺时针旋转90°
t.circle(-100,45) #顺时针为-,逆时针为+,后面是长度,第二个参数为旋转角度。
t.right(90)
t.goto(0,0)

t.end_fill()

标签:顺时针,风轮,旋转,180,right,90,绘制,fill
From: https://www.cnblogs.com/JK8395/p/16793237.html

相关文章