public class Complex
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
double |
im
Imaginary part.
|
double |
re
Real part.
|
Constructor and Description |
---|
Complex(double re,
double im) |
Modifier and Type | Method and Description |
---|---|
Complex |
add(Complex z)
Adds z to this and also returns this, to be chainable.
|
Complex |
add(double x)
Adds real x to this and also returns this, to be chainable.
|
Angle |
arg()
Returns polar angle.
|
Complex |
assign(Complex z)
Sets this from z and also returns this, to be chainable.
|
Complex |
clone()
Returns a new Complex object with the same fields.
|
Complex |
conjugate()
Conjugates this and also returns this, to be chainable.
|
Complex |
divide(Complex z)
Divides this by z and returns this, to be chainable.
|
Complex |
divide(double x)
Divides this by real x and also returns this, to be chainable.
|
boolean |
equals(java.lang.Object other) |
static Complex |
expi(Angle theta)
Get exp (i.theta) = cos (theta) + i.sin (theta).
|
static Complex |
expi(double theta)
Get exp (i.theta) = cos (theta) + i.sin (theta).
|
int |
hashCode() |
double |
mod()
Returns |z| = root sum of squares of real and imaginary parts.
|
Complex |
multiply(Complex z)
Multiplies this by z and also returns this, to be chainable.
|
Complex |
multiply(double x)
Multiplies this by real x and also returns this, to be chainable.
|
Complex |
subtract(Complex z)
Subtracts z from this and also returns this, to be chainable.
|
Complex |
subtract(double x)
Subtracts real x from this and also returns this, to be chainable.
|
java.lang.String |
toString() |
public Complex clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public double mod()
public Angle arg()
public Complex conjugate()
public Complex add(double x)
public Complex subtract(Complex z)
public Complex subtract(double x)
public Complex multiply(Complex z)
public Complex multiply(double x)
public Complex divide(double x)
public static Complex expi(double theta)