This JavaScript tutorial explains how to use the math feature known as cosh() with syntax and examples.
Description
In JavaScript, cosh() is a characteristic that is used to return the hyperbolic cosine of a number. Because the cosh() characteristic is a static feature of the Math object, it ought to be invoked via the placeholder object referred to as Math.
Syntax
In JavaScript, the syntax for the cosh() function is:
Math.cosh(number);
Parameters or Arguments
number The quantity used to calculate the hyperbolic cosine.
Returns
The cosh() function returns the hyperbolic cosine of a number.
Note
Math is a placeholder object that includes mathematical features and constants of which cosh() is one of these functions.
Example
Let’s take a seem at an example of how to use the cosh() feature in JavaScript.
For example:
console.log(Math.cosh(0.8));
console.log(Math.cosh(1));
console.log(Math.cosh(-5));
In this example, we have invoked the cosh() characteristic the usage of the Math class.
We have written the output of the cosh() function to the internet browser console log, for demonstration purposes, to show what the cosh() characteristic returns.
The following will be output to the net browser console log:
1.3374349463048447
1.5430806348152437
74.20994852478785
In this example, the first output to the console log returned 1.3374349463048447 which is the hyperbolic cosine of 0.8.
The 2d output to the console log back 1.5430806348152437 which is the hyperbolic cosine of 1.
The 0.33 output to the console log back 74.20994852478785 which is the hyperbolic cosine of -5.
Leave a Review