math求旋转角度 python_带有Python示例的math.degrees()方法
Python math.degrees() 方法
math.degrees()方法是数学模块的一种库方法,用于将角度值从弧度转换为度,它接受一个数字并返回以度为单位的角度值。
注意: math.degrees()方法仅接受数字,如果我们提供除数字以外的其他任何内容,它将返回错误TypeError – “ TypeError:需要浮点数”。
它的语法 math.degrees() 方法:
math.degrees(x)
Parameter(s): x –是要转换为度的弧度数。
返回值: float-它返回一个浮点值,即以度为单位的角度值。
示例
Input:
x = 10.25
# 函数调用
print(math.degrees(x))
Output:
587.2817400090938
Python代码演示示例 math.degrees() 方法
# Python代码演示示例
# math.degrees() method
# 导入数学模块
import math
# 弧度数
x = 0
print("math.degrees(",x,"): ", math.degrees(x))
x = 0.25
print("math.degrees(",x,"): ", math.degrees(x))
x = 10.25
print("math.degrees(",x,"): ", math.degrees(x))
x = -0.25
print("math.degrees(",x,"): ", math.degrees(x))
输出结果
math.degrees( 0 ): 0.0
math.degrees( 0.25 ): 14.32394487827058
math.degrees( 10.25 ): 587.2817400090938
math.degrees( -0.25 ): -14.32394487827058
TypeError示例
# Python代码演示示例
# math.degrees() method with exception
# 导入数学模块
import math
# 弧度数
x = "10"
print("math.degrees(",x,"): ", math.degrees(x))
输出结果
Traceback (most recent call last):
File "/home/main.py", line 9, in
print("math.degrees(",x,"): ", math.degrees(x))
TypeError: a float is required
math求旋转角度 python_带有Python示例的math.degrees()方法相关推荐
- tanh python_带有Python示例的math.tanh()方法
tanh python Python math.tanh()方法 (Python math.tanh() method) math.tanh() method is a library method ...
- math.trunc_带有Python示例的math.trunc()方法
math.trunc Python math.trunc()方法 (Python math.trunc() method) math.trunc() method is a library metho ...
- np.isfinite_带有Python示例的math.isfinite()方法
np.isfinite Python math.isfinite()方法 (Python math.isfinite() method) math.isfinite() method is a lib ...
- factorial函数_带有Python示例的math.factorial()方法
factorial函数 Python math.factorial()方法 (Python math.factorial() method) math.factorial() method is a ...
- np.copysign_带有Python示例的math.copysign()方法
np.copysign Python math.copysign()方法 (Python math.copysign() method) math.copysign() method is a lib ...
- 带有Python示例的math.sin()方法
Python math.sin()方法 (Python math.sin() method) math.sin() method is a library method of math module, ...
- tf.acos_带有Python示例的math.acos()方法
tf.acos Python math.acos()方法 (Python math.acos() method) math.acos() method is a library method of m ...
- math.atan2_带有Python示例的math.atan2()方法
math.atan2 Python math.atan2()方法 (Python math.atan2() method) math.atan2() method is a library metho ...
- css degrees_带有Python示例的math.degrees()方法
css degrees Python math.degrees()方法 (Python math.degrees() method) math.degrees() method is a librar ...
最新文章
- 独家 | 利用Auto ARIMA构建高性能时间序列模型(附Python和R代码)
- Eclipse编译时保留方法的形参
- [Node.js] 模块化 -- url、querystring模块
- 业界分享 | 阿里达摩院:超大规模预训练语言模型落地实践
- windows netstat taskkill命令 操作进程
- Linux系统中安装软件的三种方法
- 学习笔记12-SG90舵机
- C语言经典笔试题解析,原来微软笔试题也有简单的,C语言学习专题
- Servlet中request.getParameter和getParameterValues getParameterNames三者区别
- 大型网站技术架构核心原理与案例分析(李智慧)学习笔记2--大型网站架构五大核心要素
- python实战(一)Python爬取猫眼评分排行前100电影及简单数据分析可视化
- 我读《格鲁夫给经理人的第一课》
- 2048游戏制作html,一个自制的2048小游戏(一)
- ORA-12560:TNS:协议适配器错误的解决方案
- Elasticserch 5.6到Elasticsearch7.11跨版本升级踩坑记录
- Spark学习痛点和路线图
- 機器學習基石 机器学习基石 (Machine Learning Foundations) 作业二 Q19-20 C++实现
- Amlogic S905Y4 机顶盒KM7
- 原声js 的兼容(屏幕尺寸、事件处理程序、阻止事件冒泡、事件目标等等)
- 免费的档案管理系统介绍