What is Math.Atanh() in C#?

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

Syntax

public static double Atanh (double value);

Parameters

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

Return value

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

    • -∞ < θ < -1 (radians)

      or

    • 1 < θ < ∞ (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 > 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.Atanh(0);
System.Console.WriteLine("Atanh(0) = "+ result + " radians");
Double result2 = Math.Atanh(0.5);
System.Console.WriteLine("Atanh(0.5) = "+ result2 + " radians");
Double result3 = Math.Atanh(2);
System.Console.WriteLine("Atanh(2) = "+ result3);
}
}

Free Resources