Java Math.cosh(double x)

Syntax

Math.cosh(double x) has the following syntax.

public static double cosh(double x)

Example

In the following code shows how to use Math.cosh(double x) method.


//from   ww  w . j a  va  2 s. co  m
public class Main {

   public static void main(String[] args) {

      double x = 45.0;
      double y = 180.0;

      // convert them to radians
      x = Math.toRadians(x);
      y = Math.toRadians(y);

      // output their hyperbolic cosine
      System.out.println("Math.cosh(" + x + ")=" + Math.cosh(x));
      System.out.println("Math.cosh(" + y + ")=" + Math.cosh(y));


   }
}

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