Package ffx.numerics.math
Class ComplexNumber
java.lang.Object
ffx.numerics.math.ComplexNumber
ComplexNumber class.
- Since:
- 1.0
- Author:
- Timothy D. Fenn
-
Constructor Summary
ConstructorDescriptionConstructor for ComplexNumber.ComplexNumber
(double real, double imag) Constructor for ComplexNumber. -
Method Summary
Modifier and TypeMethodDescriptiondouble
abs()
absReturn a new Complex object whose value is the conjugate of this.void
conjugateIPvoid
copycos()
Return a new Complex object whose value is the complex cosine of this.Return a / b.exp()
Return a new Complex object whose value is the complex exponential of this.double
im()
imvoid
im
(double im) imReturn a new Complex object whose value is (this - b).void
minusIPdouble
phase()
phasephaseShift
(double s) phaseShiftstatic ComplexNumber
phaseShift
(ComplexNumber a, double s) Static version of phaseShift.void
phaseShiftIP
(double s) phaseShiftIPReturn a new Complex object whose value is (this + b).void
plusIPdouble
re()
revoid
re
(double re) reReturn a new Complex object whose value is the reciprocal of this.void
reciprocalIPsin()
Return a new Complex object whose value is the complex sine of this.tan()
Return a new Complex object whose value is the complex tangent of this.times
(double alpha) Return a new object whose value is (this * alpha).Return a new Complex object whose value is (this * b).void
timesIP
(double alpha) timesIPvoid
timesIPtoString()
-
Constructor Details
-
ComplexNumber
public ComplexNumber()Constructor for ComplexNumber. -
ComplexNumber
public ComplexNumber(double real, double imag) Constructor for ComplexNumber.- Parameters:
real
- a double.imag
- a double.
-
-
Method Details
-
phaseShift
Static version of phaseShift.- Parameters:
a
- aComplexNumber
object.s
- a double.- Returns:
- a
ComplexNumber
object.
-
abs
public double abs()abs- Returns:
- a double.
-
conjugate
Return a new Complex object whose value is the conjugate of this.- Returns:
- a
ComplexNumber
object.
-
conjugateIP
public void conjugateIP()conjugateIP -
copy
copy- Parameters:
b
- aComplexNumber
object.
-
cos
Return a new Complex object whose value is the complex cosine of this.- Returns:
- a
ComplexNumber
object.
-
divides
Return a / b.- Parameters:
b
- aComplexNumber
object.- Returns:
- a
ComplexNumber
object.
-
exp
Return a new Complex object whose value is the complex exponential of this.- Returns:
- a
ComplexNumber
object.
-
im
public double im()im- Returns:
- a double.
-
im
public void im(double im) im- Parameters:
im
- a double.
-
minus
Return a new Complex object whose value is (this - b).- Parameters:
b
- aComplexNumber
object.- Returns:
- a
ComplexNumber
object.
-
minusIP
minusIP- Parameters:
b
- aComplexNumber
object.
-
phase
public double phase()phase- Returns:
- a double.
-
phaseShift
phaseShift- Parameters:
s
- a double.- Returns:
- a
ComplexNumber
object.
-
phaseShiftIP
public void phaseShiftIP(double s) phaseShiftIP- Parameters:
s
- a double.
-
plus
Return a new Complex object whose value is (this + b).- Parameters:
b
- aComplexNumber
object.- Returns:
- a
ComplexNumber
object.
-
plusIP
plusIP- Parameters:
b
- aComplexNumber
object.
-
re
public double re()re- Returns:
- a double.
-
re
public void re(double re) re- Parameters:
re
- a double.
-
reciprocal
Return a new Complex object whose value is the reciprocal of this.- Returns:
- a
ComplexNumber
object.
-
reciprocalIP
public void reciprocalIP()reciprocalIP -
sin
Return a new Complex object whose value is the complex sine of this.- Returns:
- a
ComplexNumber
object.
-
tan
Return a new Complex object whose value is the complex tangent of this.- Returns:
- a
ComplexNumber
object.
-
times
Return a new Complex object whose value is (this * b).- Parameters:
b
- aComplexNumber
object.- Returns:
- a
ComplexNumber
object.
-
times
Return a new object whose value is (this * alpha).- Parameters:
alpha
- a double.- Returns:
- a
ComplexNumber
object.
-
timesIP
timesIP- Parameters:
b
- aComplexNumber
object.
-
timesIP
public void timesIP(double alpha) timesIP- Parameters:
alpha
- a double.
-
toString
-