Home  >  Article  >  Web Front-end  >  javascript atan() 计算数字的反正切值

javascript atan() 计算数字的反正切值

WBOY
WBOYOriginal
2016-06-01 09:54:441891browse

atan 方法返回数字的反正切值。

基本语法

<code class="language-javascript">Math.atan(number)</code>

必选项number 参数是需要计算反正切的数值表达式。

返回值

返回值为其数字参数的反正切值。 反正切值是 -PI/2 到 PI/2 之间的弧度值。

实例:

<code class="language-javascript"><script type="text/javascript">
document.write(Math.atan(0.60) + "<br />")
document.write(Math.atan(-0.90) + "<br />")
document.write(Math.atan(20) + "<br />")
document.write(Math.atan(10) + "<br />")
document.write(Math.atan(-8) + "<br />")
document.write(Math.atan("bb"))
</script></code>

在线运行

运行结果:

<code class="language-javascript">0.5404195002705842
-0.7328151017865066
1.5208379310729538
1.4711276743037347
-1.446441332248135
NaN</code>

 

Statement:
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