我不认为C#库包含弧双曲线三角函数,但它们很容易计算:
atanh(x) = (log(1+x) - log(1-x))/2
Run Code Online (Sandbox Code Playgroud)
在C#中:
public static double ATanh(double x)
{
return (Math.Log(1 + x) - Math.Log(1 - x))/2;
}
Run Code Online (Sandbox Code Playgroud)
你为什么不自己实现一个?你可以在这里找到等式,而且 tt 并不难:
public static class MyMath
{
public static double Arctanh(double x)
{
if (Math.Abs(x) > 1)
throw new ArgumentException("x");
return 0.5 * Math.Log((1 + x) / (1 - x));
}
}
Run Code Online (Sandbox Code Playgroud)