Java.lang.StrictMath.asin() 方法
描述
java.lang.StrictMath.asin() 方法返回一个值的反正弦值。返回的角度在 -pi/2 through pi/2 范围内。 它包括这些情况 −
- 如果参数为 NaN 或其绝对值大于 1,则结果为 NaN。
- 如果参数为零,则结果为零,符号与参数相同。
声明
以下是 java.lang.StrictMath.asin() 方法的声明。
public static double asin(double a)
参数
a − 这是要返回其反正弦的值。
返回值
此方法返回参数的反正弦值。
异常
NA
示例
下面的例子展示了 java.lang.StrictMath.asin() 方法的使用。
package com.tutorialspoint;
import java.lang.*;
public class StrictMathDemo {
public static void main(String[] args) {
double d1 = 0.90 , d2 = 5.00, d3 = 0;
// returns the arc sine of a value
double dAbsValue = StrictMath.asin(d1);
System.out.println("arc sine value of " + d1 + " = " + dAbsValue);
// returns NaN if argument is NaN or its absolute value is greater than 1
dAbsValue = StrictMath.asin(d2);
System.out.println("arc sine value of " + d2 + " = " + dAbsValue);
// returns zero if the argument is 0
dAbsValue = StrictMath.asin(d3);
System.out.println("arc sine value of " + d3 + " = " + dAbsValue);
}
}
让我们编译并运行上面的程序,这将产生下面的结果 −
arc sine value of 0.9 = 1.1197695149986342 arc sine value of 5.0 = NaN arc sine value of 0.0 = 0.0

