
package com.logicbig.example.math;
public class CoshExample {
public static void main(String... args) {
findHyperbolicCosine(90);
findHyperbolicCosine(60);
findHyperbolicCosine(45);
findHyperbolicCosine(30);
findHyperbolicCosine(0);
}
private static void findHyperbolicCosine(double angleInDegree) {
double angleInRadians = Math.toRadians(angleInDegree);
double cosh = Math.cosh(angleInRadians);
System.out.printf("Cosh of angle %s = %1.3f%n", angleInDegree, cosh);
}
}
Output
Cosh of angle 90.0 = 2.509
Cosh of angle 60.0 = 1.600
Cosh of angle 45.0 = 1.325
Cosh of angle 30.0 = 1.140
Cosh of angle 0.0 = 1.000