国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

JavaScript中的Math.atan2()方法使用詳解

2019-11-20 12:15:24
字體:
供稿:網(wǎng)友

 這個(gè)方法返回其參數(shù)商數(shù)的反正切。該ATAN2方法返回-pi和PI 較(x,y)點(diǎn)的角度theta之間的數(shù)值。
語法

Math.atan2( x, y ) ;

下面是參數(shù)的詳細(xì)信息:

  •     x 和 y : 一個(gè)數(shù)字.

返回值:

返回一個(gè)數(shù)弧度的反正切值

Math.atan2( ±0, -0 ) returns ±PI.Math.atan2( ±0, +0 ) returns ±0.Math.atan2( ±0, -x ) returns ±PI for x < 0.Math.atan2( ±0, x ) returns ±0 for x > 0.Math.atan2( y, ±0 ) returns -PI/2 for y > 0.Math.atan2( ±y, -Infinity ) returns ±PI for finite y > 0.Math.atan2( ±y, +Infinity ) returns ±0 for finite y > 0.Math.atan2( ±Infinity, +x ) returns ±PI/2 for finite x.Math.atan2( ±Infinity, -Infinity ) returns ±3*PI/4.Math.atan2( ±Infinity, +Infinity ) returns ±PI/4.

例子:

<html><head><title>JavaScript Math atan2() Method</title></head><body><script type="text/javascript">var value = Math.atan2(90,15);document.write("First Test Value : " + value );  var value = Math.atan2(15,90);document.write("<br />Second Test Value : " + value ); var value = Math.atan2(0, -0);document.write("<br />Third Test Value : " + value ); var value = Math.atan2(+Infinity, -Infinity);document.write("<br />Fourth Test Value : " + value ); </script></body></html>

這將產(chǎn)生以下結(jié)果:

First Test Value : 1.4056476493802698Second Test Value : 0.16514867741462683Third Test Value : 3.141592653589793Fourth Test Value : 2.356194490192345 

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 金塔县| 榆林市| 遵化市| 本溪| 凤翔县| 长兴县| 灵武市| 绵竹市| 临沂市| 九龙坡区| 达拉特旗| 无棣县| 新龙县| 类乌齐县| 汾阳市| 舟山市| 武清区| 都兰县| 青州市| 巨鹿县| 新密市| 武汉市| 华容县| 类乌齐县| 德令哈市| 泰兴市| 九江县| 阿瓦提县| 郎溪县| 通河县| 曲阜市| 项城市| 多伦县| 赞皇县| 高青县| 巧家县| 灵石县| 林西县| 永和县| 东海县| 徐闻县|