Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Java asin() Method

Java asin() Method

Java Number ClassThe Java Number class


The asin() method returns the arc sine of the specified double argument.

Syntax



double asin(double d)

Parameters

Return Value

Returns the arc sine of the specified double argument.

Example



public class Test{ 

    public static void main(String args[]){



        double degrees = 45.0;

        double radians = Math.toRadians(degrees);



        System.out.format("pi 的值为 %.4f%n", Math.PI);

        System.out.format("%.4f 的反正弦值为 %.4f 度 %n", Math.sin(radians), Math.toDegrees(Math.asin(Math.sin(radians))));



    }

}

Compile the above program; the output is:



pi 的值为 3.1416

0.7071 的反正弦值为 45.0000 度 


Java Number ClassThe Java Number class