本文整理汇总了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);
}
示例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 ± INFINITY i) = 0 + NaN i
* tan(±INFINITY + i) = NaN + NaN i
* tan(±INFINITY ± INFINITY i) = NaN + NaN i
* tan(±π/2 + 0 i) = ±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);
}
示例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 ± INFINITY i) = NaN + NaN i
* tanh(±INFINITY + i) = NaN + 0 i
* tanh(±INFINITY ± INFINITY i) = NaN + NaN i
* tanh(0 + (π/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);
}
示例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 ± INFINITY i) = 0 + NaN i
* tan(±INFINITY + i) = NaN + NaN i
* tan(±INFINITY ± INFINITY i) = NaN + NaN i
* tan(±π/2 + 0 i) = ±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);
}
示例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 ± INFINITY i) = NaN + NaN i
* tanh(±INFINITY + i) = NaN + 0 i
* tanh(±INFINITY ± INFINITY i) = NaN + NaN i
* tanh(0 + (π/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);
}
示例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 ± INFINITY i) = NaN + NaN i
* tanh(±INFINITY + i) = NaN + 0 i
* tanh(±INFINITY ± 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);
}
示例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 ± INFINITY i) = 0 + NaN i
* tan(±INFINITY + i) = NaN + NaN i
* tan(±INFINITY ± INFINITY i) = NaN + NaN i
* tan(±π/2 + 0 i) = ±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);
}
示例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 ± INFINITY i) = NaN + NaN i
* cosh(±INFINITY + i) = INFINITY ± INFINITY i
* cosh(±INFINITY ± 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));
}