np.radians

Python math.radians()方法 (Python math.radians() method)

math.radians() method is a library method of math module, it is used to convert angle value from degree to radians, it accepts a number and returns the angle value in radians.

math.radians()方法数学模块的库方法,用于将角度值从度转换为弧度,它接受一个数字并以弧度返回角度值。

Note: math.radians() method accepts only numbers, if we provide anything else except the number, it returns error TypeError"TypeError: a float is required".

注意: math.radians()方法仅接受数字,如果我们提供除数字以外的任何其他内容,它将返回错误TypeError“ TypeError:需要浮点数”

Syntax of math.radians() method:

math.radians()方法的语法:

    math.radians(x)

Parameter(s): x – is the number in degree to be converted into radians.

参数: x –是要转换为弧度的度数。

Return value: float – it returns a float value that is the angle value in radians.

返回值: float-它返回一个浮点值,即以弧度为单位的角度值。

Example:

例:

    Input:
x = 10.25
# function call
print(math.radians(x))
Output:
0.17889624832941878

Python代码演示math.radians()方法的示例 (Python code to demonstrate example of math.radians() method)

# Python code to demonstrate example of
# math.radians() method
# importing math module
import math
# number in radians
x = 0
print("math.radians(",x,"): ", math.radians(x))
x = 0.25
print("math.radians(",x,"): ", math.radians(x))
x = 10.25
print("math.radians(",x,"): ", math.radians(x))
x = -0.25
print("math.radians(",x,"): ", math.radians(x))

Output

输出量

math.radians( 0 ):  0.0
math.radians( 0.25 ):  0.004363323129985824
math.radians( 10.25 ):  0.17889624832941878
math.radians( -0.25 ):  -0.004363323129985824

TypeError example

TypeError示例

# Python code to demonstrate example of
# math.radians() method with exception
# importing math module
import math
# number in radians
x = "10"
print("math.radians(",x,"): ", math.radians(x))

Output

输出量

Traceback (most recent call last):
File "/home/main.py", line 9, in <module>
print("math.radians(",x,"): ", math.radians(x))
TypeError: a float is required

翻译自: https://www.includehelp.com/python/math-radians-method-with-example.aspx

np.radians

np.radians_带有Python示例的math.radians()方法相关推荐

  1. np.isfinite_带有Python示例的math.isfinite()方法

    np.isfinite Python math.isfinite()方法 (Python math.isfinite() method) math.isfinite() method is a lib ...

  2. np.copysign_带有Python示例的math.copysign()方法

    np.copysign Python math.copysign()方法 (Python math.copysign() method) math.copysign() method is a lib ...

  3. python中 math.isfinite返回值为false_带有Python示例的math.isfinite()方法

    Python math.isfinite() 方法 math.isfinite()方法是数学模块的一种库方法,用于检查给定数字是否为非有限数,它接受数字(整数/浮点数,有限,无限或NaN),如果数字既 ...

  4. python中math.ceil是什么意思_带有Python示例的math.ceil()方法

    Python math.ceil() 方法 math.ceil()方法是数学模块的库方法,用于获取给定数字的ceil值,它接受数字/数字表达式并返回大于该数字的最小整数值. 注意:如果数字是整数值,则 ...

  5. math求旋转角度 python_带有Python示例的math.degrees()方法

    Python math.degrees() 方法 math.degrees()方法是数学模块的一种库方法,用于将角度值从弧度转换为度,它接受一个数字并返回以度为单位的角度值. 注意: math.deg ...

  6. python教程cos_带有Python示例的math.cos()方法

    Python math.cos() 方法 math.cos()方法是数学模块的库方法,用于获取弧度数的余弦值,它接受一个数字,返回给定弧度的余弦值. 注意: math.cos()方法接受的唯一的号码, ...

  7. python math.sinh_带有Python示例的math.sinh()方法

    Python math.sinh() 方法 math.sinh()方法是数学模块的一种库方法,用于获取以弧度为单位的给定数字的双曲正弦值,它接受一个数字并返回双曲正弦值. 注意: math.sinh( ...

  8. math.trunc_带有Python示例的math.trunc()方法

    math.trunc Python math.trunc()方法 (Python math.trunc() method) math.trunc() method is a library metho ...

  9. factorial函数_带有Python示例的math.factorial()方法

    factorial函数 Python math.factorial()方法 (Python math.factorial() method) math.factorial() method is a ...

最新文章

  1. 那些jdk中坑你没商量的方法
  2. MITRE:利用微生物组时间序列数据推断与宿主状态变化相关的特征
  3. DOM对象和JQUERY对象
  4. PAT甲级1152 Google Recruitment :[C++题解]判质数
  5. springmvc rest风格化案例
  6. form表单通过checkbox_飞冰表单解决方案 - FormBinder
  7. 【C++ STL学习之六】STL算法之for_each
  8. ORA-00906 missing left parenthesis括号
  9. 虚拟机客户端访问不了服务器域名,虚拟机ESXI 篇四:让你电脑打开网页不用等待---SmartDns...
  10. 如何把iPhone投屏到Mac屏幕上进行演示和录制?
  11. signature=bf81fe7f4f17ad23bbd6aa8f365d3bc7,【迅雷高端用户入门手册】(第七集)简单分析迅雷崩溃...
  12. 探秘金山隐私保险箱 (解密出加密的数据)
  13. 注意力CBMA到底在网络中做了什么事
  14. PPT模板制作图片折叠效果怎么做?
  15. x_train, x_test, y_train, y_test到底是什么?
  16. Arduino超声波传感器使用
  17. python函数实验总结_Python程序设计实验报告:实验六 函数
  18. Multisim--软件相关使用技巧
  19. HTML俄罗斯方块小游戏
  20. 实用的日语翻译软件及翻译网址

热门文章

  1. curl php 百度,php curl 模拟登录百度主页
  2. 反思 大班 快乐的机器人_幼儿园大班教案《快乐的桌椅》含反思
  3. 【数据结构1.3笔记】研究内容
  4. java properties用法_java中Properties文件加载和使用方法
  5. java 序列化声明_显式声明默认Java类序列化方法的原因是什么?
  6. 井通swtc能不能涨到2元_买一支2块到3块之间的股票,买几十万股吗?这样操作效果怎么样?...
  7. pyhton 面向对象(下)
  8. JDK源码解析之java.util.AbstractCollection
  9. UVA1586 ​​​​​​​ Molar mass
  10. SQL Server如何链接到 Oracle并查询其中的数据?并实现做接口