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.
public static double Atanh (double value);
Double
type and represents the input value for which we have to find Atanh()
. Its range must be:
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.
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);}}