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

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

Introduction

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

Prototype

public Complex tan() 

Source Link

Document

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

Usage

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

/**
 * c = tan(a) /*ww  w  . j a va 2s  . co  m*/
 * 
 * @param a
 *            a
 * @param c
 *            c
 */
final public static void complexTan(GeoVec2D a, GeoVec2D c) {
    Complex out = new Complex(a.x, a.y);
    out = out.tan();
    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 ww  w . j  av a  2  s  .c  o  m
 * 
 * @param a
 *            a
 * @param c
 *            c
 */
final public static void complexCot(GeoVec2D a, GeoVec2D c) {
    Complex out = new Complex(a.x, a.y);
    out = Complex.ONE.divide(out.tan());

    c.x = out.getReal();
    c.y = out.getImaginary();

    c.setMode(Kernel.COORD_COMPLEX);
}