Package org.tweetyproject.math
Class ComplexNumber
java.lang.Object
java.lang.Number
org.tweetyproject.math.ComplexNumber
-
Constructor Summary
ConstructorDescriptionComplexNumber
(double real, double imag) Constructs a new complex number with the given real and imaginary parts. -
Method Summary
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
ComplexNumber
public ComplexNumber(double real, double imag) Constructs a new complex number with the given real and imaginary parts.- Parameters:
real
- the real part.imag
- the imaginary part.
-
-
Method Details
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
intValue
-
longValue
-
getRealPart
public double getRealPart()Returns the real part of this complex number.- Returns:
- the real part of this complex number.
-
getImagPart
public double getImagPart()Returns the imaginary part of this complex number.- Returns:
- the imaginary part of this complex number.
-
toString
-