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

推荐订阅源

WordPress大学
WordPress大学
A
About on SuperTechFans
量子位
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog
U
Unit 42
D
DataBreaches.Net
博客园 - Franky
D
Docker
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Hugging Face - Blog
Hugging Face - Blog

博客园 - 子墨老师

画一个红色灯笼 画一个哆啦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()