JavaScript Math.cosh() Method
Shubham Vora
Jan 30, 2023
We can get the hyperbolic cosine value of the number using the Math.cosh()
method. Here, we can calculate the hyperbolic cosine of the number using the expression (e^numberValue + e^(1/numberValue)/2
.
Syntax
let number = 2;
Math.cosh(number);
Parameters
x |
It is a required parameter. The Math.cosh() calculates the hyperbolic cosine for the x value. |
Returns
The Math.cosh()
method returns hyperbolic cosine of x
. Note that the hyperbolic cosine would be of the Number
type.
Example Code: Use Math.cosh()
to Get Hyperbolic Cosine
We have taken different numeric values in the example below, for which we will find the hyperbolic cosine values and observe the output.
let numberValue1 = 10;
let numberValue2 = 2.4;
console.log(Math.cosh(numberValue1));
console.log(Math.cosh(numberValue2));
Output:
11013.232920103324
5.556947166965507
To get the hyperbolic cosine value, computer programmers can use the Math.cosh()
method with all modern browsers.
Author: Shubham Vora