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

WBOY
Release: 2016-06-10 15:12:30
Original
1820 people have browsed it

 atan()方法返回x的反正切值,以弧度表示。
Syntax

以下是atan()方法的语法:

atan(x)

注意:此函数是无法直接访问的,所以我们需要导入math模块,然后需要用math的静态对象来调用这个函数。
参数

  •     x -- 这必须是一个数值。

返回值

此方法返回 x 的反正切值,以弧度表示。
例子

下面的例子显示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)

Copy after login

当我们运行上面的程序,它会产生以下结果:

atan(0.64) : 0.569313191101
atan(0) : 0.0
atan(10) : 1.4711276743
atan(-1) : -0.785398163397
atan(1) : 0.785398163397

Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!