Java Math.acos(double a)

Syntax

Math.acos(double a) has the following syntax.

public static double acos(double a)

Example

In the following code shows how to use Math.acos(double a) method.


//w w w .  j  a v  a2s.co m
public class Main {

   public static void main(String[] args) {

      double x = Math.PI / 2;

      x = Math.toRadians(x);

      System.out.println("Math.acos(" + x + ")=" + Math.acos(x));
   }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable