How to get the hyperbolic cosine of a double value in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
        
        System.out.println("Math.cosh(-1) = " + Math.cosh(-1));
        System.out.println("Math.cosh(1) = " + Math.cosh(1));
        System.out.println("Math.cosh(0) = " + Math.cosh(0));
        System.out.println("Math.cosh(-0) = " + Math.cosh(-0));
        System.out.println("Math.cosh(0.9) = " + Math.cosh(0.9));
        System.out.println("Math.cosh(Math.PI) = " + Math.cosh(Math.PI));
        System.out.println("Math.cosh(Math.PI * 2) = " + Math.cosh(Math.PI * 2));
        System.out.println("Math.cosh(Math.PI / 2) = " + Math.cosh(Math.PI / 2));
        System.out.println("Math.cosh(Math.PI / 3) = " + Math.cosh(Math.PI / 3));
    }
}
 
/*
run:

Math.cosh(-1) = 1.543080634815244
Math.cosh(1) = 1.543080634815244
Math.cosh(0) = 1.0
Math.cosh(-0) = 1.0
Math.cosh(0.9) = 1.4330863854487745
Math.cosh(Math.PI) = 11.591953275521519
Math.cosh(Math.PI * 2) = 267.7467614837482
Math.cosh(Math.PI / 2) = 2.5091784786580567
Math.cosh(Math.PI / 3) = 1.600286857702386
 
*/

 



answered Sep 9, 2016 by avibootz

Related questions

1 answer 169 views
1 answer 204 views
1 answer 130 views
1 answer 177 views
...