What is Math.sinh() in JavaScript?
Math in JavaScript is a built-in object that contains different methods and properties to perform mathematical operations. It contains a sinh() function , which is used to compute the hyperbolic sine of a specified angle.
Syntax
Math.sinh(param);
Parameter
param: This is the angle for which we want to compute the hyperbolic sine. Its type isNumber, and it is measured in radians.
Numberin JavaScript is a 64-bit double-precision value which is the same as adoublein C# or Java.
Return value
-
Number: It returns the hyperbolic sine of the given angle stored inparam. It is of theNumbertype. -
+Infinity: The function returns this for positiveInfinityas input. -
-Infinity: The function returns this for negativeInfinityas input.
Use the following formula to convert degrees to radians.
- Radians = Degrees x π /180
where
π= 3.14159, approximately.
Code
console.log("sinh(-1) = " + Math.sinh(-1));console.log("sinh(0) = " + Math.sinh(0));console.log("sinh(1) = " + Math.sinh(1));console.log("sinh(∞) = " + Math.sinh(Infinity));console.log("sinh(-∞) = " + Math.sinh(-Infinity));