public class Complex
extends java.lang.Object
Constructor and Description |
---|
Complex(double realPart)
Constructor with pure real number
|
Complex(double realPart,
double imaginaryPart)
Primary constructor
|
Modifier and Type | Method and Description |
---|---|
Complex |
conjugate()
complex conjugate
|
Complex |
divide(Complex divisor)
complex division
|
Complex |
divide(double divisor)
complex division
|
double |
imaginary()
get the imaginary part
|
Complex |
minus(Complex subtrahend)
complex subtraction
|
Complex |
minus(double subtrahend)
complex subtraction
|
double |
modulus()
modulus of this complex number
|
double |
modulusSquared()
modulus squared of this complex number
|
Complex |
negate()
calculate the negative of this complex number
|
double |
phase()
get the phase
|
Complex |
plus(Complex addend)
complex addition
|
Complex |
plus(double addend)
complex addition
|
double |
real()
get the real part
|
Complex |
reciprocal()
calculate the reciprocal of this complex number
|
Complex |
times(Complex multiplier)
complex multiplaction
|
Complex |
times(double multiplier)
complex multiplaction
|
java.lang.String |
toString()
Get a string representation of this complex number
|
public Complex(double realPart, double imaginaryPart)
public Complex(double realPart)
public java.lang.String toString()
toString
in class java.lang.Object
public final double real()
public final double imaginary()
public final Complex negate()
public final double modulus()
public final double phase()
public final double modulusSquared()
public final Complex conjugate()
public final Complex reciprocal()
public final Complex times(double multiplier)
public final Complex divide(double divisor)
public final Complex plus(double addend)
public final Complex minus(double subtrahend)