Package com.xinapse.image
Class FloatComplex
java.lang.Object
com.xinapse.image.Complex
com.xinapse.image.FloatComplex
A complex (real, imaginary) number, with single precision.
-
Constructor Summary
ConstructorDescriptionCreates a newFloatComplex
number, with zero real and imaginary parts.FloatComplex
(float r, float i) Creates a newFloatComplex
number, with the real and imaginary parts specified by the arguments.Creates a newFloatComplex
number, with the real and imaginary parts copied from an existingComplex
. -
Method Summary
Modifier and TypeMethodDescriptionAdds the value of this complex number to another complex number, and returns the result.conj()
Returns the complex conjugate of this complex number.Divides this complex by another complex number, and returns the result.boolean
Determines whether another object is equal to thisFloatComplex
number.expi()
Returns the exponential of this complex number multiplied by i.double
getArg()
Returns the polar angle of this complex number.double
getImag()
Returns the imaginary part of this complex number.double
getMod()
Returns the modulus of this complex number.double
getModSq()
Returns the square of the modulus of this complex number.double
getReal()
Returns the real part of this complex number.int
hashCode()
Returns a hash code value for thisFloatComplex
number.boolean
isZero()
Tests whether this complex number is zero.log()
Returns the natural log of this complex number.Multiplies this complex number by another complex number, and returns the result.static FloatComplex
polar
(float mod, float arg) Creates a newFloatComplex
given the modulus and argument (in radians).scale
(double factor) Scales this Complex by a real scalar value and returns the result.Subtracts another complex number from this complex number, and returns the result.toString()
Returns a string representation of this complex number.
-
Constructor Details
-
FloatComplex
public FloatComplex()Creates a newFloatComplex
number, with zero real and imaginary parts. -
FloatComplex
public FloatComplex(float r, float i) Creates a newFloatComplex
number, with the real and imaginary parts specified by the arguments.- Parameters:
r
- the real part of the complex number.i
- the imaginary part of the complex number.
-
FloatComplex
Creates a newFloatComplex
number, with the real and imaginary parts copied from an existingComplex
.- Parameters:
c
- theComplex
to copy.
-
-
Method Details
-
polar
Creates a newFloatComplex
given the modulus and argument (in radians).- Parameters:
mod
- the modulus.arg
- the argument in radians.- Returns:
- a new
FloatComplex
from the modulus and argument.
-
getReal
public double getReal()Description copied from class:Complex
Returns the real part of this complex number. -
getImag
public double getImag()Description copied from class:Complex
Returns the imaginary part of this complex number. -
getArg
public double getArg()Description copied from class:Complex
Returns the polar angle of this complex number. -
getMod
public double getMod()Description copied from class:Complex
Returns the modulus of this complex number. -
getModSq
public double getModSq()Description copied from class:Complex
Returns the square of the modulus of this complex number. -
add
Description copied from class:Complex
Adds the value of this complex number to another complex number, and returns the result. -
subtract
Description copied from class:Complex
Subtracts another complex number from this complex number, and returns the result. -
multiply
Description copied from class:Complex
Multiplies this complex number by another complex number, and returns the result. -
divide
Description copied from class:Complex
Divides this complex by another complex number, and returns the result. -
scale
Description copied from class:Complex
Scales this Complex by a real scalar value and returns the result. -
conj
Description copied from class:Complex
Returns the complex conjugate of this complex number. -
expi
Description copied from class:Complex
Returns the exponential of this complex number multiplied by i. -
log
Description copied from class:Complex
Returns the natural log of this complex number. -
isZero
public boolean isZero()Description copied from class:Complex
Tests whether this complex number is zero. -
equals
Determines whether another object is equal to thisFloatComplex
number.
The result is true if and only if the argument is not null and is aFloatComplex
object that has the same real and imaginary components as thisFloatComplex
object. -
hashCode
public int hashCode()Returns a hash code value for thisFloatComplex
number.- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this
FloatComplex
number.
-
toString
Description copied from class:Complex
Returns a string representation of this complex number.
-