当前位置:首页 > 开发教程 > js/jQuery教程 >

数学三角函数正弦, 余弦, 正切, 余弦, 正切 方法

时间:2013-04-25 10:47 来源:网络整理 作者:采集侠 收藏

主题: Math 我们可以使用预定义的数学对象的方法或函数计算三角值。我们可以计算正弦,余弦,正切,反余弦,反正弦,反正切值。 在使用Math.sin函数,要获得角度或度的值,例如:sin(30o),并转换为弧度,例如:Math.sin(30*Math.PI/180)。 下面的表列出了函


主题: Math

      我们可以使用预定义的数学对象的方法或函数计算三角值。我们可以计算正弦,余弦,正切,反余弦,反正弦,反正切值。

在使用Math.sin函数,要获得角度或度的值,例如:sin(30o),并转换为弧度,例如:Math.sin(30*Math.PI/180)。
下面的表列出了函数及其应用。

常量 示例代码 结果 说明

sin(int) Math.sin(1); Math.sin(x) x为弧度,返回sin(x)的正弦值,x为弧度

cos(int) Math.cos(1); Math.cos(x) 返回cos(x)的余弦值,x为弧度

tan(int) Math.tan(1); Math.tan(1) 返回tan(1)的正切值,x为弧度

asin(int) Math.asin(1); Math.asin(x) 返回asin(x) 反正弦值,x为弧度

acos(int) Math.acos(1); Math.acos(x) 返回acos(x) 反余弦值,x为弧度

atan(int) Math.atan(1); Math.atan(x) 返回atan(x) 反正切值,x为弧度




js/jQuery教程阅读排行

最新文章