public class Complex
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
Complex(double real,
double imag)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
abs()
Returns abs/modulus/magnitude.
|
Complex |
conjugate()
Returns the conjugate.
|
Complex |
cos()
Returns the complex cosine.
|
Complex |
div(Complex b)
Returns a / b.
|
boolean |
equals(java.lang.Object o) |
Complex |
exp()
Returns the complex exponential.
|
int |
hashCode() |
double |
im()
Returns the imaginary part.
|
Complex |
minus(Complex b)
Returns this - b.
|
double |
phase()
Returns angle/phase/argument between -pi and pi.
|
Complex |
plus(Complex b)
Returns this + b.
|
double |
re()
Returns the real part.
|
Complex |
reciprocal()
Returns the reciprocal.
|
Complex |
sin()
Returns the complex sine.
|
Complex |
tan()
Returns the complex tangent.
|
Complex |
times(Complex b)
Returns this * b.
|
Complex |
times(double b)
Scalar multiplication.* Returns this * b.
|
java.lang.String |
toString() |
public Complex(double real,
double imag)
real - real partimag - imaginary partpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic double abs()
public double phase()
public Complex times(double b)
public Complex conjugate()
public Complex reciprocal()
public double re()
public double im()
public Complex exp()
public Complex sin()
public Complex cos()
public Complex tan()