Package org.openscience.cdk.math
Class Complex
java.lang.Object
org.openscience.cdk.math.Complex
This class handles complex values.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a complex valuevoidDiv this value by a complex valuedoubleGets the imaginary part of this valuedoubleGets the real part of this complex valuevoidMultiply this value with a complex valuevoidsetImaginaryPart(double imag) Sets the imaginary part of this valuevoidsetRealPart(double real) Sets the real part of this complex valuevoidSubtracs a complex valuetoString()Create a string of the content of this class
-
Field Details
-
real
public double realThe real part of this value -
imag
public double imagThe imaginary part of this value
-
-
Constructor Details
-
Complex
public Complex(double real, double imag) Creates a complex number- Parameters:
real- the real partimag- the imaginary part
-
Complex
Creates a copy of a complex object
-
-
Method Details
-
setRealPart
public void setRealPart(double real) Sets the real part of this complex value -
getRealPart
public double getRealPart()Gets the real part of this complex value -
setImaginaryPart
public void setImaginaryPart(double imag) Sets the imaginary part of this value -
getImaginaryPart
public double getImaginaryPart()Gets the imaginary part of this value -
add
Add a complex value -
sub
Subtracs a complex value -
mul
Multiply this value with a complex value -
div
Div this value by a complex value -
toString
Create a string of the content of this class
-