惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
罗磊的独立博客
T
Tailwind CSS Blog
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs

博客园 - 子墨老师

画一个红色灯笼 画一个哆啦A梦 画一个小黄人 画一个Android智能手机机器人 基于Hutool的poi导出excel表格【升级更新】 如何设置wps单元格下拉选项设置 Caused by: org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception ZoomIt的使用与快捷键 springboot项目中使用Java 8的日期时间API 基于springboot系统,如何跟踪会话过期,浏览器会话标识是否收到正常响应,存储,并在后续请求保持携带 SpringBoot+MyBatis实现数据库字段加密 Vue2中能否实现输入中文自动转化为拼音, 且不带音调 Excel导出问题:accessExternalStylesheet 解构赋值+扩展运算符在数组和对象上的应用例子 收藏一下JDK下载地址 介绍几个axios接口请求顺序的问题 vue cli的介绍 Failed to start nginx.service: Unit nginx.service not found. 如何实现文件批量重命名后再进行批量打包下载 如何能成功在centos7下安装nodejs18+以上版本 centos7下卸载nodejs源码包 基于ConcurrentMap锁机制的NFS文件合并方案 基于ConcurrentMap锁机制的NFS分片上传方案 如何将已经存在的本地项目源码关联到远程git仓库中 gitee如何使用 centos7安装php+wordpress
画一个太极八卦图
子墨老师 · 2026-08-26 · via 博客园 - 子墨老师

画一个太极八卦图,效果如下图
 
要求:
1.大圆坐标(0,-200),半径200
2.黑色大半圆:半径100
3.白色大半圆:半径100
4.黑色小半圆:半径25,坐标(0,-100)
5.白色小半圆:半径25,坐标(0,100)

image

参考代码

import turtle

#最大圆
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)

#移动到最上方
turtle.penup()
turtle.goto(0,200)
turtle.left(180)
turtle.pendown()

#黑色大半圆
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(100,360)
turtle.end_fill()
turtle.fillcolor('black')
turtle.begin_fill()
turtle.left(180)
turtle.circle(-200,180)
turtle.end_fill()

#白色大半圆
turtle.home()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(-100,180)
turtle.pencolor('white')
turtle.circle(-100,180)
turtle.end_fill()

#白色小圆
turtle.penup()
turtle.goto(0,100)
turtle.pendown()
turtle.dot(50,'white')

#黑色小圆
turtle.penup()
turtle.goto(0,-100)
turtle.pendown()
turtle.dot(50,'black')

turtle.hideturtle()