⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tanh.java

📁 JAVA 数学程序库 提供常规的数值计算程序包
💻 JAVA
字号:
package jmathlib.toolbox.trigonometric;

import jmathlib.core.functions.ExternalElementWiseFunction;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;

public class tanh extends ExternalElementWiseFunction
{
    
    public tanh()
    {
        name = "tanh";
    }
    
    /**Calculates the 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)
    {
        sinh sinhF = new sinh();
        cosh coshF = new cosh();
        
        double[] temp1 = sinhF.evaluateValue(arg);
        double[] temp2 = coshF.evaluateValue(arg);
        
        DoubleNumberToken  num = new DoubleNumberToken();
        
        return num.divide(temp1, temp2);
    }
    
}

/*
@GROUP
trigonometric
@SYNTAX
tanh(angle)
@DOC
Returns the hyperbolic tangent of angle.
@EXAMPLES
<programlisting>
tanh(0) = 0
tanh(1) = 0.76159
</programlisting>
@SEE
tan, atanh, cos, sin
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -