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

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

Introduction

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

Prototype

public Complex log() 

Source Link

Document

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

Usage

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

/**
 * c = a ^ b Michael Borcherds 2009-03-10
 * //from   w  w  w  . jav a  2  s  . c  o  m
 * @param a
 *            base
 * @param b
 *            power
 * @param c
 *            result
 */
final public static void complexPower(GeoVec2D a, NumberValue b, GeoVec2D c) {
    Complex out = new Complex(a.x, a.y);
    out = out.log().multiply(b.getDouble()).exp();
    c.x = out.getReal();
    c.y = out.getImaginary();
    c.setMode(Kernel.COORD_COMPLEX);
}

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

/**
 * c = natural log(a) Michael Borcherds 2009-03-10
 * /*from   w ww  .ja  va 2s .c  o m*/
 * @param a
 *            a
 * @param c
 *            logaritmus of a
 */
final public static void complexLog(GeoVec2D a, GeoVec2D c) {
    Complex out = new Complex(a.x, a.y);
    out = out.log();
    c.x = out.getReal();
    c.y = out.getImaginary();
    c.setMode(Kernel.COORD_COMPLEX);
}