Package org.openscience.cdk.math
Class Complex
- java.lang.Object
-
- org.openscience.cdk.math.Complex
-
public class Complex extends Object
This class handles complex values.- Belongs to CDK module:
- qm
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Complex c)
Add a complex valuevoid
div(Complex c)
Div this value by a complex valuedouble
getImaginaryPart()
Gets the imaginary part of this valuedouble
getRealPart()
Gets the real part of this complex valuevoid
mul(Complex c)
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
sub(Complex c)
Subtracs a complex valueString
toString()
Create a string of the content of this class
-
-
-
Constructor Detail
-
Complex
public Complex(double real, double imag)
Creates a complex number- Parameters:
real
- the real partimag
- the imaginary part
-
Complex
public Complex(Complex c)
Creates a copy of a complex object
-
-
Method Detail
-
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
public void add(Complex c)
Add a complex value
-
sub
public void sub(Complex c)
Subtracs a complex value
-
mul
public void mul(Complex c)
Multiply this value with a complex value
-
div
public void div(Complex c)
Div this value by a complex value
-
-