Package org.openscience.cdk.math
Class Complex
java.lang.Object
org.openscience.cdk.math.Complex
This class handles complex values.
- Belongs to CDK module:
- qm
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a complex valuevoid
Div this value by a complex valuedouble
Gets the imaginary part of this valuedouble
Gets the real part of this complex valuevoid
Multiply this value with a complex valuevoid
setImaginaryPart
(double imag) Sets the imaginary part of this valuevoid
setRealPart
(double real) Sets the real part of this complex valuevoid
Subtracs 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
-