java tutorial - Java Math.acos() Method - tutorial java - java programming - learn java- java basics - java for beginners



Java numbers acos

Learn Java - Java tutorial - Java numbers acos - Java examples - Javaprograms

Description

The Math.acos () method returns the arc cosine of the radian value.

Syntax

double acos(double d)
click below button to copy the code. By - java tutorial - team

Options

Detailed information about the parameters:

  • d is the double data type.

Return value

  • In Java, Math.acos () returns the arc cosine of the double value specified in radians.

Sample Code

public class Test { 

   public static void main(String args[]) {
      double degrees = 45.0;
      double radians = Math.toRadians(degrees);

      System.out.format("The value of pi is %.5f%n", Math.PI);
      System.out.format("The arccosine of %.5f is %.5f degrees %n", Math.cos(radians),
         Math.toDegrees(Math.acos(Math.cos(radians))));
   }
}
click below button to copy the code. By - java tutorial - team

Output

The value of pi is 3.1416
The arccosine of 0.7071 is 45.0000 degrees 

Table of the main values of the arccosine:

 arccos-table

Learn java - java tutorial - arccos table - java examples - java programs


Related Searches to Java Math.acos() Method