📄 atanh.java
字号:
package jmathlib.toolbox.trigonometric;
import jmathlib.core.functions.ExternalElementWiseFunction;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.toolbox.jmathlib.matrix.log;
public class atanh extends ExternalElementWiseFunction
{
public atanh()
{
name = "atanh";
}
/**Calculates the inverse hyperbolic tangent of a complex number
* @param arg = the angle as an array of double
* @return the result as an array of double
*/
public double[] evaluateValue(double[] arg)
{
double result[] = new double[2];
// atanh(z) = 1/2 * log( (1+z)/(1-z) )
// _1: one.Minus(z) ...
double[] temp = new double[2];
temp[REAL] = 1 - arg[REAL];
temp[IMAG] = - arg[IMAG];
// result: one.Plus(z) ...
result[REAL] = 1 + arg[REAL];
// result: result.Div(_1) ...
DoubleNumberToken num = new DoubleNumberToken();
result = num.divide(result, temp);
// _1: result.log() ...
log logFunc = new log();
result = logFunc.evaluateValue(result);
// result: _1.scale(0.5) ...
result[REAL] = 0.5 * result[REAL];
result[IMAG] = 0.5 * result[IMAG];
return result;
}
}
/*
@GROUP
trigonometric
@SYNTAX
atanh(value)
@DOC
Returns the arc hyperbolic tangent of the first value.
@EXAMPLES
<programlisting>
atanh(1) = NaN
atanh(0) = 0
</programlisting>
@SEE
tan, tanh
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -