JavaScript | Math.acosh() function
The Math.acosh() function is an inbuit function in JavaScript which is used to get hyperbolic arc-cosine of a number.
The hyperbolic arc-cosine is known with many names such as hyperbolic inverse cosine and acosh.It is inverse of the hyperbolic cosine function i.e, The inverse hyperbolic cosine of any value say x is the value y for which the hyperbolic cosine of y is x.
if y = acosh(x)
then x = cosh(y)For all x≥1,
we have acosh(x)=ln(x+√ x2-1 )
Syntax:
Math.acosh(x)
- Here x is a number whose hyperbolic arc-cosine is going to be calculated.
- It returns the hyperbolic arc-cosine of the given number.If the number is less than 1, it return NaN i.e, not a number.
- Here 2nd column contain int values which are version of the corresponding browser.
Feature Basic support Chrome 38 Edge Yes Firefox 25 Internet Explorer No Opera 25 Safari 8 Android webview Yes Chrome for Android Yes Edge mobile Yes Firefox for Android 25 Opera Android Yes iOS Safari 8
Parameters:
Return value:
Browser Support:
Examples:
Input: Math.acosh(1) Output: 0
Explanaition:
Here output 0 is the hyperbolic arc-cosine of a number 1.
Input: Math.acosh(2) Output: 1.3169578969248166
Input: Math.acosh(3) Output: 1.7627471740390859
Let\’s see JavaScripts program:
// Here different values is being used for // getting hyperbolic cosine function's values. console.log(Math.acosh(2)); console.log(Math.acosh(1)); console.log(Math.acosh(3)); console.log(Math.acosh(10)); |
Output:
> 1.3169578969248166 > 0 > 1.7627471740390859 > 2.993222846126381
Errors and Exceptions:
- It is an error case because complex number can not be taken as the parameter of the function only integer value can be taken as the parameter.
// complex number can not be calculated as// the hyperbolic arc-cosine.console.log(Math.acosh(1 + 2i));chevron_rightfilter_noneOutput:
Error: Invalid or unexpected token
- Other than integer nothing is accepted as the parameter of the function that is why here string as the parameter gives NaN i.e, not a number.
// Any string value as the parameter of the// function gives NaN i.e, not a number// because only number can be used as the// parameters.console.log(Math.acosh("geeksforgeeks"));console.log(Math.acosh("gfg"));chevron_rightfilter_noneOutput:
> NaN > NaN
Application:
- Whenever we need to get a get hyperbolic arc-cosine of a number that time we can take help of Math.acosh() function in JavaScript.
// Here different values is being used for getting// hyperbolic cosine function's values.console.log(Math.acosh(5));console.log(Math.acosh(12));chevron_rightfilter_noneOutput:
> 2.2924316695611777 > 3.176313180591656
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- JavaScript | Math.abs( ) function
- JavaScript | Math.E() function
- JavaScript | Array.of() function
- JavaScript | Math.pow( ) Function
- JavaScript | toExponential() Function
- JavaScript | Function Apply
- JavaScript | toPrecision( ) Function
- JavaScript | toString( ) function
- JavaScript | String() Function
- JavaScript | Function Invocation
- JavaScript | Array every() function
- JavaScript | toFixed( ) Function
- Javascript | Number() Function
- JavaScript | Function Definitions
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



