当前位置:网站首页>pygame绘制弧线
pygame绘制弧线
2022-08-02 14:09:00 【天山没有长寿茶】
pygame中绘制弧线的函数如下:
pygame.draw.arc(surface, color, rect, start_angle, stop_angle, width)需要传入的参数:
- surface:画布(screen)
- color:颜色
- rect:弧线所在矩形框
- start_angle:弧线起始角度(弧度制0~2
) - stop_angle:弧线终止角度(弧度制0~2
) - width:默认为1(当≤0的时候啥也不画)
其中rect,start_angle,stop_angle比较难理解。首先rect为pygame中定义的一个矩形,定义方式为Rect(left, top, width, height) ,由4个数组成的元组定义而成,各数含义如下,分别是左上角点的坐标,矩形的宽度与高度:

我们先在矩形Rect内作内切圆或椭圆(图中红色虚线椭圆),再结合start_angle与stop_angle便可定义我们的弧线(图中粗红线):

边栏推荐
- FP7122降压恒流内置MOS耐压100V共正极阳极PWM调光方案原理图
- PyTorch(12)---损失函数和反向传播
- Win11 computer off for a period of time without operating network how to solve
- “非图灵完备”到底意味着什么
- Win7 encounters an error and cannot boot into the desktop normally, how to solve it?
- PyTorch⑤---卷积神经网络_卷积层
- FP6296锂电池升压 5V9V12V内置 MOS 大功率方案原理图
- win11一直弹出用户账户控制怎么解决
- 【系统设计与实现】基于flink的分心驾驶预测与数据分析系统
- Failed to install using npx -p @storybook/cli sb init, build a dedicated storybook by hand
猜你喜欢

Win7怎么干净启动?如何只加载基本服务启动Win7系统

语言模型(NNLM)

PyTorch①---加载数据、tensorboard的使用

PyTorch⑨---卷积神经网络_线性层

How to add a one-key shutdown option to the right-click menu in Windows 11

图像配置分类及名词解释

How to reinstall Win7 system with U disk?How to reinstall win7 using u disk?

2020-02-06-快速搭建个人博客

【系统设计与实现】基于flink的分心驾驶预测与数据分析系统

How to set the win10 taskbar does not merge icons
随机推荐
How to update Win11 sound card driver?Win11 sound card driver update method
Win11怎么在右键菜单添加一键关机选项
13.56MHZ刷卡芯片CI521兼容cv520/ci520支持A卡B卡MIFARE协议
最小树高度
Do Windows 10 computers need antivirus software installed?
CS4398音频解码替代芯片DP4398完全兼容DAC解码
基于深度学习的配准框架
What should I do if the Win10 system sets the application identity to automatically prompt for access denied?
让深度学习歇一会吧
Binder ServiceManager解析
win10怎么设置不睡眠熄屏?win10设置永不睡眠的方法
ECP2459耐压60V降压BUCK电路用于WIFI模块供电方案原理图
DP4344兼容CS4344-DA转换器
Win10电脑需要安装杀毒软件吗?
PyTorch(15)---模型保存和加载
投资组合理论的简单介绍
The problem that UIWindow's makeKeyAndVisible does not call viewDidLoad of rootviewController
内存申请(malloc)和释放(free)之上篇
Win10 Settings screen out from lack of sleep?Win10 set the method that never sleep
DP1101兼容CC1101是SUB1GHz无线收发芯片应用于智能家居
)