1. 首页
  2. 数据库
  3. 其它
  4. 94 – 绘制谢尔宾斯基三角形

94 – 绘制谢尔宾斯基三角形

上传者: 2020-12-23 00:56:45上传 PDF文件 97.71KB 热度 15次
绘制谢尔宾斯基三角形 import turtle # 绘制单个三角形 # [[x1,y1], [x2,y2], [x3,y3]] def draw_triangle(points, color, t): t.fillcolor(color) t.up() # 将画笔移动到第一个点 t.goto(points[0][0], points[0][1]) t.down() t.begin_fill() t.goto(points[1][0], points[1][1]) t.goto(points[2][0], points[2][1
下载地址
用户评论