Java Math sinh()

The hyperbolic sine is equivalent to (ex - e-x)/2, where e is Euler's number.

The syntax of the sinh() method is:

Math.sinh(double value)

Here, sinh() is a static method. Hence, we are accessing the method using the class name, Math.


sinh() Parameters

The sinh() method takes a single parameter.

  • value - angle whose hyperbolic function is to be determined

Note: The value is generally used in radians.


sinh() Return Values

  • returns the hyperbolic sine of value
  • returns NaN if the argument value is NaN

Note: If the argument is zero or infinity, then the method returns the same value zero or infinity with the same sign as in argument.


Example 1: Java Math sinh()

In the above example, notice the expression,

Math.sinh(value1)

Here, we have directly used the class name to call the method. It is because sinh() is a static method.

Note: We have used the Java Math.toRadians() method to convert all the values into radians.


Example 2: sinh() Returns NaN, Zero, and Infinite

Here,

  • Double.POSITIVE_INFINITY - implements positive infinity in Java
  • Double.NEGATIVE_INFINITY - implements negative infinity in Java
  • Math.sqrt(-5) - square root of a negative number is not a number

Note:We have used the Java Math.sqrt() method to calculate the square root of a number.


Recommended Tutorials