数学库中Math.tanh的倒数在哪里?

y = Math.Tanh(x)y = Math.Tanh(x)的双曲正切。 但我需要f(y) = x 。 对于常规切线,有Arctan,但是哪里是Arctanh?

谢谢!

我不认为C#库包含arc双曲线trig函数,但它们很容易计算:

 atanh(x) = (log(1+x) - log(1-x))/2 

在C#中:

 public static double ATanh(double x) { return (Math.Log(1 + x) - Math.Log(1 - x))/2; } 

你为什么不自己实施一个? 你可以在这里找到方程式,而不是那么困难:

 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)); } } 

反向HTangent可以通过做Log((1 + X)/(1 – X))/ 2来计算

我从包管理器安装了MathNet。 它有MathNet.Numerics.Trig.InverseHyperbolicTangent(x),效果很好。