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
Doubletype and represents the input value for which we have to findAtanh(). 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
NaNtype for an invalid range ofvalue, i.e.,:-
value< -1or
-
value> 1or
-
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);}}