当前位置: 首页>>代码示例>>Java>>正文


Java MathUtils.cosh方法代码示例

本文整理汇总了Java中org.apache.commons.math.util.MathUtils.cosh方法的典型用法代码示例。如果您正苦于以下问题:Java MathUtils.cosh方法的具体用法?Java MathUtils.cosh怎么用?Java MathUtils.cosh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math.util.MathUtils的用法示例。


在下文中一共展示了MathUtils.cosh方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: COSH

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
public double COSH(double number) {
	return MathUtils.cosh(number);
}
 
开发者ID:netxilia,项目名称:netxilia,代码行数:4,代码来源:MathFunctions.java

示例2: tan

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the 
 * <a href="http://mathworld.wolfram.com/Tangent.html" TARGET="_top">
 * tangent</a> of this complex number.
 * <p>
 * Implements the formula: <pre>
 * <code>tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]i</code></pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, 
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.</p>
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the 
 * input argument is <code>NaN</code>.</p>
 * <p>
 * Infinite (or critical) values in real or imaginary parts of the input may
 * result in infinite or NaN values returned in parts of the result.<pre>
 * Examples: 
 * <code>
 * tan(1 &plusmn; INFINITY i) = 0 + NaN i
 * tan(&plusmn;INFINITY + i) = NaN + NaN i
 * tan(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 * tan(&plusmn;&pi;/2 + 0 i) = &plusmn;INFINITY + NaN i</code></pre></p>
 * 
 * @return the tangent of this complex number
 * @since 1.2
 */
public Complex tan() {
    if (isNaN()) {
        return Complex.NaN;
    }
    
    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = Math.cos(real2) + MathUtils.cosh(imaginary2);
    
    return createComplex(Math.sin(real2) / d, MathUtils.sinh(imaginary2) / d);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:38,代码来源:Complex.java

示例3: tanh

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/HyperbolicTangent.html" TARGET="_top">
 * hyperbolic tangent</a> of this complex number.
 * <p>
 * Implements the formula: <pre>
 * <code>tan(a + bi) = sinh(2a)/(cosh(2a)+cos(2b)) + [sin(2b)/(cosh(2a)+cos(2b))]i</code></pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, 
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.</p>
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the 
 * input argument is <code>NaN</code>.</p>
 * <p>
 * Infinite values in real or imaginary parts of the input may result in
 * infinite or NaN values returned in parts of the result.<pre>
 * Examples: 
 * <code>
 * tanh(1 &plusmn; INFINITY i) = NaN + NaN i
 * tanh(&plusmn;INFINITY + i) = NaN + 0 i
 * tanh(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 * tanh(0 + (&pi;/2)i) = NaN + INFINITY i</code></pre></p>
 *
 * @return the hyperbolic tangent of this complex number
 * @since 1.2
 */
public Complex tanh() {
    if (isNaN()) {
        return Complex.NaN;
    }
    
    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = MathUtils.cosh(real2) + Math.cos(imaginary2);
    
    return createComplex(MathUtils.sinh(real2) / d, Math.sin(imaginary2) / d);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:38,代码来源:Complex.java

示例4: tan

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/Tangent.html" TARGET="_top">
 * tangent</a> of this complex number.
 * <p>
 * Implements the formula: <pre>
 * <code>tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]i</code></pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos},
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.</p>
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the
 * input argument is <code>NaN</code>.</p>
 * <p>
 * Infinite (or critical) values in real or imaginary parts of the input may
 * result in infinite or NaN values returned in parts of the result.<pre>
 * Examples:
 * <code>
 * tan(1 &plusmn; INFINITY i) = 0 + NaN i
 * tan(&plusmn;INFINITY + i) = NaN + NaN i
 * tan(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 * tan(&plusmn;&pi;/2 + 0 i) = &plusmn;INFINITY + NaN i</code></pre></p>
 *
 * @return the tangent of this complex number
 * @since 1.2
 */
public Complex tan() {
    if (isNaN()) {
        return Complex.NaN;
    }

    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = Math.cos(real2) + MathUtils.cosh(imaginary2);

    return createComplex(Math.sin(real2) / d, MathUtils.sinh(imaginary2) / d);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:38,代码来源:Complex.java

示例5: tanh

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/HyperbolicTangent.html" TARGET="_top">
 * hyperbolic tangent</a> of this complex number.
 * <p>
 * Implements the formula: <pre>
 * <code>tan(a + bi) = sinh(2a)/(cosh(2a)+cos(2b)) + [sin(2b)/(cosh(2a)+cos(2b))]i</code></pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos},
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.</p>
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the
 * input argument is <code>NaN</code>.</p>
 * <p>
 * Infinite values in real or imaginary parts of the input may result in
 * infinite or NaN values returned in parts of the result.<pre>
 * Examples:
 * <code>
 * tanh(1 &plusmn; INFINITY i) = NaN + NaN i
 * tanh(&plusmn;INFINITY + i) = NaN + 0 i
 * tanh(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 * tanh(0 + (&pi;/2)i) = NaN + INFINITY i</code></pre></p>
 *
 * @return the hyperbolic tangent of this complex number
 * @since 1.2
 */
public Complex tanh() {
    if (isNaN()) {
        return Complex.NaN;
    }

    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = MathUtils.cosh(real2) + Math.cos(imaginary2);

    return createComplex(MathUtils.sinh(real2) / d, Math.sin(imaginary2) / d);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:38,代码来源:Complex.java

示例6: tanh

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/HyperbolicTangent.html" TARGET="_top">
 * hyperbolic tangent</a> for the given complex argument.
* <p>
 * Implements the formula: <pre>
 * <code>tan(a + bi) = sinh(2a)/(cosh(2a)+cos(2b)) + [sin(2b)/(cosh(2a)+cos(2b))]i</code></pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, 
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the 
 * input argument is <code>NaN</code>.
 * <p>
 * Infinite values in real or imaginary parts of the input may result in
 * infinite or NaN values returned in parts of the result.<pre>
 * Examples: 
 * <code>
 * tanh(1 &plusmn; INFINITY i) = NaN + NaN i
 * tanh(&plusmn;INFINITY + i) = NaN + 0 i
 * tanh(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 * tanh(0 + (&pi/2)i) = NaN + INFINITY i</code></pre>
 *
 * @param z the value whose hyperbolic tangent is to be returned
 * @return the hyperbolic tangent of <code>z</code>
 * @throws NullPointerException if <code>z</code> is null
 */
public static Complex tanh(Complex z) {
    if (z.isNaN()) {
        return Complex.NaN;
    }
    
    double a2 = 2.0 * z.getReal();
    double b2 = 2.0 * z.getImaginary();
    double d = MathUtils.cosh(a2) + Math.cos(b2);
    
    return new Complex(MathUtils.sinh(a2) / d, Math.sin(b2) / d);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:39,代码来源:ComplexUtils.java

示例7: tan

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/Tangent.html" TARGET="_top">
 * tangent</a> of this complex number.
 * Implements the formula:
 * <pre>
 *  <code>
 *   tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]i
 *  </code>
 * </pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos},
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.
 * <br/>
 * Returns {@link Complex#NaN} if either real or imaginary part of the
 * input argument is {@code NaN}.
 * <br/>
 * Infinite (or critical) values in real or imaginary parts of the input may
 * result in infinite or NaN values returned in parts of the result.
 * <pre>
 *  Examples:
 *  <code>
 *   tan(1 &plusmn; INFINITY i) = 0 + NaN i
 *   tan(&plusmn;INFINITY + i) = NaN + NaN i
 *   tan(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 *   tan(&plusmn;&pi;/2 + 0 i) = &plusmn;INFINITY + NaN i
 *  </code>
 * </pre>
 *
 * @return the tangent of {@code this}.
 * @since 1.2
 */
public Complex tan() {
    if (isNaN) {
        return NaN;
    }

    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = FastMath.cos(real2) + MathUtils.cosh(imaginary2);

    return createComplex(FastMath.sin(real2) / d,
                         MathUtils.sinh(imaginary2) / d);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:45,代码来源:Complex.java

示例8: cosh

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
 * Compute the 
 * <a href="http://mathworld.wolfram.com/HyperbolicCosine.html" TARGET="_top">
 * hyperbolic cosine</a> for the given complex argument.
 * <p>
 * Implements the formula: <pre>
 * <code> cosh(a + bi) = cosh(a)cos(b) + sinh(a)sin(b)i</code></pre>
 * where the (real) functions on the right-hand side are
 * {@link java.lang.Math#sin}, {@link java.lang.Math#cos}, 
 * {@link MathUtils#cosh} and {@link MathUtils#sinh}.
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the 
 * input argument is <code>NaN</code>.
 * <p>
 * Infinite values in real or imaginary parts of the input may result in
 * infinite or NaN values returned in parts of the result.<pre>
 * Examples: 
 * <code>
 * cosh(1 &plusmn; INFINITY i) = NaN + NaN i
 * cosh(&plusmn;INFINITY + i) = INFINITY &plusmn; INFINITY i
 * cosh(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i</code></pre>
 * <p>
 * Throws <code>NullPointerException</code> if z is null.
 * 
 * @param z the value whose hyperbolic cosine is to be returned.
 * @return the hyperbolic cosine of <code>z</code>.
 */
public static Complex cosh(Complex z) {
    if (z.isNaN()) {
        return Complex.NaN;
    }
    
    double a = z.getReal();
    double b = z.getImaginary();
    
    return new Complex(MathUtils.cosh(a) * Math.cos(b),
        MathUtils.sinh(a) * Math.sin(b));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:39,代码来源:ComplexUtils.java


注:本文中的org.apache.commons.math.util.MathUtils.cosh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。