Close

Java - Math.sinh() Examples

Java Java API 


Class:

java.lang.Math

java.lang.Objectjava.lang.Objectjava.lang.Mathjava.lang.MathLogicBig

Method:

public static double sinh(double x)

Returns the hyperbolic sine of a double value. The hyperbolic sine of x is defined to be (ex - e-x)/2 where e is Euler's number.


Examples


package com.logicbig.example.math;

public class SinhExample {

public static void main(String... args) {
findHyperbolicSine(90);
findHyperbolicSine(60);
findHyperbolicSine(45);
findHyperbolicSine(30);
findHyperbolicSine(0);
}

private static void findHyperbolicSine(double angleInDegree) {
double angleInRadians = Math.toRadians(angleInDegree);
double sinh = Math.sinh(angleInRadians);
System.out.printf("Sinh of angle %s = %1.3f%n", angleInDegree, sinh);
}
}

Output

Sinh of angle 90.0 = 2.301
Sinh of angle 60.0 = 1.249
Sinh of angle 45.0 = 0.869
Sinh of angle 30.0 = 0.548
Sinh of angle 0.0 = 0.000




See Also