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
ConstructorsConstructorDescriptionCreates a newFloatComplexnumber, with zero real and imaginary parts.FloatComplex(float r, float i) Creates a newFloatComplexnumber, with the real and imaginary parts specified by the arguments.Creates a newFloatComplexnumber, 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.booleanDetermines whether another object is equal to thisFloatComplexnumber.expi()Returns the exponential of this complex number multiplied by i.doublegetArg()Returns the polar angle of this complex number.doublegetImag()Returns the imaginary part of this complex number.doublegetMod()Returns the modulus of this complex number.doublegetModSq()Returns the square of the modulus of this complex number.doublegetReal()Returns the real part of this complex number.inthashCode()Returns a hash code value for thisFloatComplexnumber.booleanisZero()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 FloatComplexpolar(float mod, float arg) Creates a newFloatComplexgiven 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 newFloatComplexnumber, with zero real and imaginary parts. -
FloatComplex
public FloatComplex(float r, float i) Creates a newFloatComplexnumber, 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 newFloatComplexnumber, with the real and imaginary parts copied from an existingComplex.- Parameters:
c- theComplexto copy.
-
-
Method Details
-
polar
Creates a newFloatComplexgiven the modulus and argument (in radians).- Parameters:
mod- the modulus.arg- the argument in radians.- Returns:
- a new
FloatComplexfrom the modulus and argument.
-
getReal
public double getReal()Description copied from class:ComplexReturns the real part of this complex number. -
getImag
public double getImag()Description copied from class:ComplexReturns the imaginary part of this complex number. -
getArg
public double getArg()Description copied from class:ComplexReturns the polar angle of this complex number. -
getMod
public double getMod()Description copied from class:ComplexReturns the modulus of this complex number. -
getModSq
public double getModSq()Description copied from class:ComplexReturns the square of the modulus of this complex number. -
add
Description copied from class:ComplexAdds the value of this complex number to another complex number, and returns the result. -
subtract
Description copied from class:ComplexSubtracts another complex number from this complex number, and returns the result. -
multiply
Description copied from class:ComplexMultiplies this complex number by another complex number, and returns the result. -
divide
Description copied from class:ComplexDivides this complex by another complex number, and returns the result. -
scale
Description copied from class:ComplexScales this Complex by a real scalar value and returns the result. -
conj
Description copied from class:ComplexReturns the complex conjugate of this complex number. -
expi
Description copied from class:ComplexReturns the exponential of this complex number multiplied by i. -
log
Description copied from class:ComplexReturns the natural log of this complex number. -
isZero
public boolean isZero()Description copied from class:ComplexTests whether this complex number is zero. -
equals
Determines whether another object is equal to thisFloatComplexnumber.
The result is true if and only if the argument is not null and is aFloatComplexobject that has the same real and imaginary components as thisFloatComplexobject. -
hashCode
public int hashCode()Returns a hash code value for thisFloatComplexnumber.- Overrides:
hashCodein classObject- Returns:
- a hash code value for this
FloatComplexnumber.
-
toString
Description copied from class:ComplexReturns a string representation of this complex number.
-