The acosh() function is used to return the inverse hyperbolic cosine in radians of the argument x passed to it.
Note: The arc hyperbolic cosine is the same as the inverse hyperbolic cosine.
Mathematically, this function is given by:
acosh(x) = x
double acosh(double x);
float acosh(float x);
long double acosh(long double x);
This function takes x as the only and mandatory parameter value.
The value of this parameter must be equal to or greater than 1. When the value passed is less than 1, a domain error is returned.
The returned value is the arc hyperbolic cosine of the argument x.
#include <iostream>#include <cmath>using namespace std;int main(){// creating variablesint x = 10;double result;// implementing the acoshresult = acosh(x);cout << "acosh(10) = " << result << " radian" << endl;return 0;}
Line 8 and 9: We create the variables x and result.
Line 12: We implement the acosh() function on the value of x and assign it to the variable result.
Line 13: We print the result variable.