当前位置:网站首页>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便可定义我们的弧线(图中粗红线):

边栏推荐
- 2022TI杯D题混沌信号产生实验装置
- How to update Win11 sound card driver?Win11 sound card driver update method
- 【系统设计与实现】基于flink的分心驾驶预测与数据分析系统
- boost库智能指针
- Please make sure you have the correct access rights and the repository exists.问题解决
- 【我的电赛日记(一)】HMI USART串口屏
- Win7遇到错误无法正常开机进桌面怎么解决?
- 刷卡芯片CI520可直接PIN对PIN替换CV520支持SPI通讯接口
- PyTorch④---DataLoader的使用
- 2.4G无线小模块CI24R1超低成本
猜你喜欢

FP7122降压恒流内置MOS耐压100V共正极阳极PWM调光方案原理图

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

FP7195降压恒流PWM转模拟调光零压差大功率驱动方案原理图

Win7遇到错误无法正常开机进桌面怎么解决?

PyTorch⑤---卷积神经网络_卷积层

Win10 computer can't read U disk?Don't recognize U disk how to solve?

Mapreduce环境详细搭建和案例实现

How to update Win11 sound card driver?Win11 sound card driver update method

How to solve Win11 without local users and groups

Win11 computer off for a period of time without operating network how to solve
随机推荐
Actual combat Meituan Nuxt +Vue family bucket, server-side rendering, mailbox verification, passport authentication service, map API reference, mongodb, redis and other technical points
单端K总线收发器DP9637兼容L9637
2.4G无线小模块CI24R1超低成本
How to reinstall Win7 system with U disk?How to reinstall win7 using u disk?
Letter combination of LeetCode2 phone number
为android系统添加产品的过程
The problem that UIWindow's makeKeyAndVisible does not call viewDidLoad of rootviewController
使用 腾讯云搭建一个个人博客
日常-笔记
Win10 Settings screen out from lack of sleep?Win10 set the method that never sleep
PyTorch(12)---损失函数和反向传播
Win10安装了固态硬盘还是有明显卡顿怎么办?
让深度学习歇一会吧
TypeScript 快速进阶
什么是外生变量和内生变量
Pytorch(16)---搭建一个完整的模型
基于51单片机和物联网的智能家居系统(ESP8266物联网模块)
数据偏见的背后是什么
关于c语言的调试技巧
FP5207电池升压 5V9V12V24V36V42V大功率方案
)