解读Python中degrees()方法的使用
作者:goldensun 时间:2021-08-21 07:13:24
degrees()方法从弧度转换到度角x
语法
以下是degrees()方法的语法:
degrees(x)
注意:此函数是无法直接访问的,所以我们需要导入math模块,然后需要用math的静态对象来调用这个函数。
参数
返回值
x -- 这必须是一个数值。
此方法返回一个角度的度数值。
例子
下面的例子显示degrees()方法的使用。
#!/usr/bin/python
import math
print "degrees(3) : ", math.degrees(3)
print "degrees(-3) : ", math.degrees(-3)
print "degrees(0) : ", math.degrees(0)
print "degrees(math.pi) : ", math.degrees(math.pi)
print "degrees(math.pi/2) : ", math.degrees(math.pi/2)
print "degrees(math.pi/4) : ", math.degrees(math.pi/4)
当我们运行上面的程序,它会产生以下结果:
degrees(3) : 171.887338539
degrees(-3) : -171.887338539
degrees(0) : 0.0
degrees(math.pi) : 180.0
degrees(math.pi/2) : 90.0
degrees(math.pi/4) : 45.0
标签:Python
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python执行ping操作的简单方法
2022-09-22 12:09:22
IIS+PHP添加对webp格式图像的支持配置方法
2023-05-28 11:20:11
JavaScript模板解析演示实例
2009-10-19 23:16:00
python中无法导入本地安装好的第三方库问题
2022-06-25 12:24:31
![](https://img.aspxhome.com/file/2023/8/91918_0s.png)
Python使用PDFMiner解析PDF代码实例
2023-03-30 06:56:45
![](https://img.aspxhome.com/file/2023/7/98927_0s.png)
教你使用Python的pygame模块实现拼图游戏
2022-06-28 03:20:20
基于selenium及python实现下拉选项定位select
2023-01-13 12:17:48
![](https://img.aspxhome.com/file/2023/8/93818_0s.png)
JAVASCRIPT实现的WEB页面跳转以及页面间传值方法
2023-08-23 04:56:09
Go语言string,int,int64 ,float之间类型转换方法
2023-06-28 15:20:30
python urllib.request模块的使用详解
2023-03-27 18:19:15
![](https://img.aspxhome.com/file/2023/7/117287_0s.png)
OpenCV停车场车位实时检测项目实践
2022-09-13 09:37:08
![](https://img.aspxhome.com/file/2023/3/118733_0s.jpg)
UCDChina.com 关于用户期望的讨论
2008-07-10 11:55:00
python教程十行代码教你语音转文字QQ微信聊天
2024-01-03 09:06:54
![](https://img.aspxhome.com/file/2023/8/127278_0s.jpg)
Javascript的匿名函数
2008-05-07 13:33:00
python PyAutoGUI 模拟鼠标键盘操作和截屏功能
2022-11-12 08:16:41
Win10安装dlib GPU过程详解
2023-12-27 08:50:08
![](https://img.aspxhome.com/file/2023/1/112461_0s.jpg)
Python线程同步的实现代码
2022-10-01 00:20:48
Python通过2种方法输出带颜色字体
2023-02-08 20:53:22
![](https://img.aspxhome.com/file/2023/7/71507_0s.png)
在ASP中用FormatDateTime格式化日期
2010-08-08 19:16:00
Python导入数值型Excel数据并生成矩阵操作
2023-05-15 16:59:24
![](https://img.aspxhome.com/file/2023/3/64263_0s.jpg)