What is Math.Acosh() in C#?

Share

C# has a built-in Math class which provides useful mathematical functions and operations. The class has the Acosh() function, which is used to compute the angle whose hyperbolic cosine comes out to be a specified number. It is also known as the inverse hyperbolic cosine of a specified number.

Syntax

public static double Acosh (double value);

Parameters

  • value: It is of the Double type and represents the input value for which we have to find Acosh(). Its range must be:

    • 1 <= value <= ∞

Return value

  • Double: This value returns an angle Θ measured in radians and its type is Double.

    • 0 <= Θ <= ∞ (radians)

    It is true only for a valid range of value.

  • NaN: The function returns NaN type for an invalid range of value, i.e.:

    • value < 1

      or

    • value = NaN

Multiply radians by 180/Math.PI to convert radians to degrees.

Example

using System;
class Educative
{
static void Main()
{
double result = Math.Acosh(5);
System.Console.WriteLine("Acosh(5) = "+ result + " radians");
double result1 = Math.Acosh(1);
System.Console.WriteLine("Acosh(1) = "+ result1 + " radians");
double result2 = Math.Acosh(-1);
System.Console.WriteLine("Acosh(-1) = "+ result2);
}
}