Java Math acos() 方法
实例
返回不同数字的反余弦值:
public class Main {public static void main(String[] args) {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 的值。
语法
参数值
| 参数 | 描述 |
|---|---|
| number | 必填。一个求其反余弦值的数字,范围为 -1 到 1。如果该值在 -1 到 1 之外,则返回 NaN(不是数字) |
技术细节
| 返回: | 一个 double 值,表示一个数字的反余弦值 |
|---|