源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

用Python计算三角函数之atan()方法的使用

  • 时间:2022-11-07 14:52 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:用Python计算三角函数之atan()方法的使用
 atan()方法返回x的反正切值,以弧度表示。 [b]Syntax[/b] 以下是atan()方法的语法: [b]atan(x)[/b] 注意:此函数是无法直接访问的,所以我们需要导入math模块,然后需要用math的静态对象来调用这个函数。 [b]参数[/b] [list] [*]    x -- 这必须是一个数值。[/*] [/list] [b]返回值[/b] 此方法返回 x 的反正切值,以弧度表示。 [b]例子[/b] 下面的例子显示atan()方法的使用。
#!/usr/bin/python
import math

print "atan(0.64) : ", math.atan(0.64)
print "atan(0) : ", math.atan(0)
print "atan(10) : ", math.atan(10)
print "atan(-1) : ", math.atan(-1)
print "atan(1) : ", math.atan(1)

当我们运行上面的程序,它会产生以下结果:
atan(0.64) : 0.569313191101
atan(0) : 0.0
atan(10) : 1.4711276743
atan(-1) : -0.785398163397
atan(1) : 0.785398163397

  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部