Java Math acos() 方法
示例
返回不同數字的反正切值
System.out.println(Math.acos(0.64));
System.out.println(Math.acos(-0.4));
System.out.println(Math.acos(0));
System.out.println(Math.acos(1));
System.out.println(Math.acos(-1));
System.out.println(Math.acos(2));
定義和用法
acos()
方法返回數字的反餘弦值。
提示:acos(-1) 返回 PI 的值。
語法
public static double abs(double number)
引數值
引數 | 描述 |
---|---|
數字 | 必需。要查詢反餘弦值的數字,範圍在 -1 到 1 之間。如果值超出 -1 到 1 的範圍,則返回 NaN(非數字)。 |
技術詳情
返回 | 一個 double 值,表示數字的反餘弦值 |
---|
❮ Math 方法