Ai
2 Star 1 Fork 1

望曦开源团队/Python案例合集

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Clover.py 733 Bytes
一键复制 编辑 原始数据 按行查看 历史
NineSenz-九练 提交于 2020-01-31 15:46 +08:00 . 绘图 四叶草
import turtle
import time
turtle.setup(650.,350,200,200)
turtle.pendown()
turtle.pensize(10)
turtle.pencolor('green')
#四叶草
def draw_clover(radius,rotate): #参数radius控制叶子的大小,rotate控制叶子的旋转
for i in range(4):
direction = i*90
turtle.seth(60+direction+rotate) #控制叶子根部的角度为60度
# turtle.fd(2*radius*pow(2,1/2)) #控制叶子根部的角度为90度
turtle.fd(4*radius)
for j in range(2):
turtle.seth(90+direction+rotate)
turtle.circle(radius,180)
turtle.seth(-60+direction+rotate)
turtle.fd(4*radius)
turtle.seth(-90)
turtle.fd(6*radius)
draw_clover(30,45)
time.sleep(5)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wangxios/workspace_Python.git
git@gitee.com:wangxios/workspace_Python.git
wangxios
workspace_Python
Python案例合集
master

搜索帮助