[英]Is there any way to get radians with asin/acos/atan functions JavaScript?
我目前正在使用 Math.js 庫來處理數學方程。
我知道可以使用帶有三角函數 sin()、cos()、tan() 的“deg”或“rad”從弧度變為度數。 但是對於弧函數 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.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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.