Javascript 有没有办法通过asin/acos/atan函数获取弧度?

Javascript 有没有办法通过asin/acos/atan函数获取弧度?,javascript,math,trigonometry,math.js,Javascript,Math,Trigonometry,Math.js,我目前正在使用Math.js库处理数学方程 我知道,通过使用“deg”或“rad”以及触发函数sin()、cos()、tan(),可以将弧度更改为度。但是对于圆弧函数asin()、cos()、tan(),它似乎不起作用。 如果除了手动计算之外,还有其他方法 test= math.eval("sin(1 deg)"); //Works test2 = math.eval("sin(1 rad)"); //Works test3= math.eval("asin(1 deg)"); //Does

我目前正在使用Math.js库处理数学方程

我知道,通过使用“deg”或“rad”以及触发函数sin()、cos()、tan(),可以将弧度更改为度。但是对于圆弧函数asin()、cos()、tan(),它似乎不起作用。 如果除了手动计算之外,还有其他方法

test= math.eval("sin(1 deg)"); //Works
test2 = math.eval("sin(1 rad)"); //Works

test3= math.eval("asin(1 deg)"); //Does not work
test4 = math.eval("asin(1 rad)"); //Does not work
你应该用

math.eval("asin(1)");
反正弦是一个使用数字作为输入值的反三角函数


如前所述,asin(x)需要deg不是的数值。

触发函数的参数(以及反向触发函数的返回值)是以弧度为单位的数字。要使用度数,请乘以或除以
Math.PI/180

Math.sin(45 * Math.PI/180) --> -.7071...

Math(Math.arctan(1)) * 180/Math.PI --> 45 (degrees)
如果您使用的是弧度,请不要乘以或除以该因子

Math.asin(1) --> 1.57...  (radians)
Math.asin(1) * 180/Math.PI -->  90   (or something close; in degrees)

@King Stone你能解释一下吗?我想javascript支持
Math
类,我们可以使用
Math.asin(1)
。我们不需要任何用于
asin
功能的库是的,我知道,但我正在使用it@EXMark2JS内置的
Math
类与您正在使用的Math.JS库不同。是否有任何方法可以使用asin()?arcin(sin(1))获得1的弧度值“这就是我理解的你想要的吗?”阿尔普萨夫鲁姆-这将给出一个接近1.000的值,它是弧度
asin
sin
是相反的。我实际上是在转换asin()中的值,这就是我得到错误结果的原因。非常感谢。