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

WBOY
Release: 2016-06-10 15:12:31
Original
1629 people have browsed it

 asin()方法返回x的反正弦,以弧度表示。
语法

以下是asin()方法语法:

asin(x)

Copy after login

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

  • x -- 这必须是在-1到1的数字值的范围内,如果x大于1,则它会产生一个错误。

返回值

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

下面的例子显示了asin()方法的使用。

#!/usr/bin/python
import math

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

Copy after login

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

asin(0.64) : 0.694498265627
asin(0) : 0.0
asin(-1) : -1.57079632679
asin(1) : 1.57079632679

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!