Example usage for org.apache.commons.math.complex Complex tanh

List of usage examples for org.apache.commons.math.complex Complex tanh

Introduction

In this page you can find the example usage for org.apache.commons.math.complex Complex tanh.

Prototype

public Complex tanh() 

Source Link

Document

Compute the <a href="http://mathworld.wolfram.com/HyperbolicTangent.html" TARGET="_top"> hyperbolic tangent</a> of this complex number.

Usage

From source file:geogebra.common.kernel.geos.GeoVec2D.java

/**
 * c = tanh(a) /*from ww  w .jav a  2  s  .co m*/
 * 
 * @param a
 *            a
 * @param c
 *            c
 */
final public static void complexTanh(GeoVec2D a, GeoVec2D c) {
    Complex out = new Complex(a.x, a.y);
    out = out.tanh();
    c.x = out.getReal();
    c.y = out.getImaginary();
    c.setMode(Kernel.COORD_COMPLEX);
}

From source file:geogebra.common.kernel.geos.GeoVec2D.java

/**
 * c = cot(a) /*from www  .j a  v a  2  s  .c om*/
 * 
 * @param a
 *            a
 * @param c
 *            c
 */
final public static void complexCoth(GeoVec2D a, GeoVec2D c) {
    Complex out = new Complex(a.x, a.y);
    out = Complex.ONE.divide(out.tanh());

    c.x = out.getReal();
    c.y = out.getImaginary();
    c.setMode(Kernel.COORD_COMPLEX);
}