FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
or by using one of the static from functions on Complex, either convenience methods, or conversion from polar coordinates in radians:
Complex c := Complex(3.1, 5.0); // 3.1 + 5i
There are also a number of convenince functions to return certain constants an Complex numbers.
Complex c := Complex.fromPolar(7.2, float.PI/2.0); // 7.2i
Action summary | |
---|---|
float |
abs()
Return the magnitude of this Complex number. |
com.apamax.Complex | static add(com.apamax.Complex a, com.apamax.Complex b)
Add two complex numbers and return a new Complex number with the result. |
float |
arg()
Return the polar angle of this Complex number. |
boolean |
bitEquals(com.apamax.Complex b)
Returns true if both the real and imaginary parts of this Complex number are bit-equals to the real and imaginary parts of the argument. |
com.apamax.Complex | static conjugate(com.apamax.Complex a)
Return a new Complex number which is the complex conjugate of the argument. |
com.apamax.Complex | static cos(com.apamax.Complex a)
Returns the cosine of the argument as a new Complex number. |
com.apamax.Complex | static divide(com.apamax.Complex a, com.apamax.Complex b)
Divide two complex numbers and return a new Complex number with the result. |
com.apamax.Complex | static divideReal(com.apamax.Complex a, float b)
Divide the given complex number by a real divisor and return the result as a new Complex number. |
com.apamax.Complex | static E()
Returns Euler's number e, represented as a complex number. |
com.apamax.Complex | static exp(com.apamax.Complex a)
Exponentiate the argument and return the result as a new Complex number. |
string |
formatFixed(integer dp)
Return the Complex number as a string with a fixed number of decimal places. e.g. 0.30-4.51i |
string |
formatScientific(integer sf)
Return the Complex number as a string in scientific notation e.g. 1.3e-2+5.6e10i |
com.apamax.Complex | static fromImaginaryFloat(float i)
Creates a Complex number with the given float as the imaginary part and 0 as the real part. |
com.apamax.Complex | static fromImaginaryInteger(integer i)
Creates a Complex number with the given integer as the imaginary part and 0 as the real part. |
com.apamax.Complex | static fromPolar(float abs, float arg)
Creates a Complex number from polar coordinates. |
com.apamax.Complex | static fromRealFloat(float r)
Creates a Complex number with the given float as the real part and 0 as the imaginary part. |
com.apamax.Complex | static fromRealInteger(integer r)
Creates a Complex number with the given integer as the real part and 0 as the imaginary part. |
com.apamax.Complex | static I()
Returns the square root of -1, i, represented as a complex number. |
float |
imag()
Returns the imaginary part of this Complex number. |
com.apamax.Complex | static INFINITY()
Returns infinity + infinity*i, represented as a complex number. |
boolean |
isFinite()
Returns true if both parts of this Complex number are finite. |
boolean |
isInfinite()
Returns true if either part of this Complex number is infinite. |
boolean |
isNaN()
Returns true if either part of this Complex number is not a number. |
com.apamax.Complex | static ln(com.apamax.Complex a)
Return the natural log of the argument as a new Complex number. |
com.apamax.Complex | static max(com.apamax.Complex a, com.apamax.Complex b)
Return the larger of two Complex numbers. |
com.apamax.Complex | static min(com.apamax.Complex a, com.apamax.Complex b)
Return the smaller of two Complex numbers. |
com.apamax.Complex | static multiply(com.apamax.Complex a, com.apamax.Complex b)
Multiply two complex numbers and return a new Complex number with the result. |
com.apamax.Complex | static multiplyReal(com.apamax.Complex a, float b)
Multiply the given complex number by a real divisor and return the result as a new Complex number. |
com.apamax.Complex | static NAN()
Returns a Complex number which is not a number. |
com.apamax.Complex | static negate(com.apamax.Complex a)
Return a new Complex number which is the negation of the argument. |
com.apamax.Complex | static ONE()
Returns 1, represented as a complex number. |
com.apamax.Complex | static PI()
Returns the constant pi, represented as a complex number. |
com.apamax.Complex | static pow(com.apamax.Complex a, com.apamax.Complex b)
Return a Complex number raised to the power of a second Complex number as a new Complex number. |
float |
real()
Returns the real part of this Complex number. |
com.apamax.Complex | static reciprocal(com.apamax.Complex a)
Return a new Complex number which is the reciprocal of the argument. |
com.apamax.Complex | static sin(com.apamax.Complex a)
Returns the sine of the argument as a new Complex number. |
com.apamax.Complex | static sqrt(com.apamax.Complex a)
Returns the square root of the argument as a new Complex number. |
com.apamax.Complex | static subtract(com.apamax.Complex a, com.apamax.Complex b)
Subtract two complex numbers and return a new Complex number with the result. |
com.apamax.Complex | static tan(com.apamax.Complex a)
Returns the tangent of the argument as a new Complex number. |
string |
toValueString()
Return the Complex number as a string. e.g. 0.3-4.5i |
com.apamax.Complex |
uadd(com.apamax.Complex b)
Set this Complex number to add the argument and return self. |
com.apamax.Complex |
uconjugate()
Assign this to its complex conjugate and return self. |
com.apamax.Complex |
udivide(com.apamax.Complex b)
Set this Complex number to be divided by the argument and return self. |
com.apamax.Complex |
udivideReal(float b)
Set this Complex number to be divided by the real argument and return self. |
com.apamax.Complex |
uexp()
Set this Complex number it's exponent (ez) and return self. |
com.apamax.Complex |
uln()
Sets this Complex number to the natural logarithm of itself and return self. |
com.apamax.Complex |
umultiply(com.apamax.Complex b)
Set this Complex number to multiply by the argument and return self. |
com.apamax.Complex |
umultiplyReal(float b)
Set this Complex number to be multiplied by the real argument and return self. |
com.apamax.Complex |
unegate()
Set this Complex number to its own negation and return self. |
com.apamax.Complex |
ureciprocal()
Set this Complex number to its own reciprocal and return self. |
com.apamax.Complex |
usqrt()
Set this Complex number to its square root and return self. |
com.apamax.Complex |
usubtract(com.apamax.Complex b)
Set this Complex number to subtract the argument and return self. |
com.apamax.Complex | static ZERO()
Returns 0, represented as a complex number. |
Action detail |
---|
float abs()Return the magnitude of this Complex number.
com.apamax.Complex static add(com.apamax.Complex a, com.apamax.Complex b)Add two complex numbers and return a new Complex number with the result.
float arg()Return the polar angle of this Complex number.
boolean bitEquals(com.apamax.Complex b)Returns true if both the real and imaginary parts of this Complex number are bit-equals to the real and imaginary parts of the argument.
com.apamax.Complex static conjugate(com.apamax.Complex a)Return a new Complex number which is the complex conjugate of the argument.
com.apamax.Complex static cos(com.apamax.Complex a)Returns the cosine of the argument as a new Complex number.
com.apamax.Complex static divide(com.apamax.Complex a, com.apamax.Complex b)Divide two complex numbers and return a new Complex number with the result.
com.apamax.Complex static divideReal(com.apamax.Complex a, float b)Divide the given complex number by a real divisor and return the result as a new Complex number.
com.apamax.Complex static E()Returns Euler's number e, represented as a complex number.
com.apamax.Complex static exp(com.apamax.Complex a)Exponentiate the argument and return the result as a new Complex number.
string formatFixed(integer dp)Return the Complex number as a string with a fixed number of decimal places. e.g. 0.30-4.51i
string formatScientific(integer sf)Return the Complex number as a string in scientific notation e.g. 1.3e-2+5.6e10i
com.apamax.Complex static fromImaginaryFloat(float i)Creates a Complex number with the given float as the imaginary part and 0 as the real part.
com.apamax.Complex static fromImaginaryInteger(integer i)Creates a Complex number with the given integer as the imaginary part and 0 as the real part.
com.apamax.Complex static fromPolar(float abs, float arg)Creates a Complex number from polar coordinates.
com.apamax.Complex static fromRealFloat(float r)Creates a Complex number with the given float as the real part and 0 as the imaginary part.
com.apamax.Complex static fromRealInteger(integer r)Creates a Complex number with the given integer as the real part and 0 as the imaginary part.
com.apamax.Complex static I()Returns the square root of -1, i, represented as a complex number.
float imag()Returns the imaginary part of this Complex number.
com.apamax.Complex static INFINITY()Returns infinity + infinity*i, represented as a complex number.
boolean isFinite()Returns true if both parts of this Complex number are finite.
boolean isInfinite()Returns true if either part of this Complex number is infinite.
boolean isNaN()Returns true if either part of this Complex number is not a number.
com.apamax.Complex static ln(com.apamax.Complex a)Return the natural log of the argument as a new Complex number.
com.apamax.Complex static max(com.apamax.Complex a, com.apamax.Complex b)Return the larger of two Complex numbers.
com.apamax.Complex static min(com.apamax.Complex a, com.apamax.Complex b)Return the smaller of two Complex numbers.
com.apamax.Complex static multiply(com.apamax.Complex a, com.apamax.Complex b)Multiply two complex numbers and return a new Complex number with the result.
com.apamax.Complex static multiplyReal(com.apamax.Complex a, float b)Multiply the given complex number by a real divisor and return the result as a new Complex number.
com.apamax.Complex static NAN()Returns a Complex number which is not a number.
com.apamax.Complex static negate(com.apamax.Complex a)Return a new Complex number which is the negation of the argument.
com.apamax.Complex static ONE()Returns 1, represented as a complex number.
com.apamax.Complex static PI()Returns the constant pi, represented as a complex number.
com.apamax.Complex static pow(com.apamax.Complex a, com.apamax.Complex b)Return a Complex number raised to the power of a second Complex number as a new Complex number.
float real()Returns the real part of this Complex number.
com.apamax.Complex static reciprocal(com.apamax.Complex a)Return a new Complex number which is the reciprocal of the argument.
com.apamax.Complex static sin(com.apamax.Complex a)Returns the sine of the argument as a new Complex number.
com.apamax.Complex static sqrt(com.apamax.Complex a)Returns the square root of the argument as a new Complex number.
com.apamax.Complex static subtract(com.apamax.Complex a, com.apamax.Complex b)Subtract two complex numbers and return a new Complex number with the result.
com.apamax.Complex static tan(com.apamax.Complex a)Returns the tangent of the argument as a new Complex number.
string toValueString()Return the Complex number as a string. e.g. 0.3-4.5i
com.apamax.Complex uadd(com.apamax.Complex b)Set this Complex number to add the argument and return self.
com.apamax.Complex uconjugate()Assign this to its complex conjugate and return self.
com.apamax.Complex udivide(com.apamax.Complex b)Set this Complex number to be divided by the argument and return self.
com.apamax.Complex udivideReal(float b)Set this Complex number to be divided by the real argument and return self.
com.apamax.Complex uexp()Set this Complex number it's exponent (ez) and return self.
com.apamax.Complex uln()Sets this Complex number to the natural logarithm of itself and return self.
com.apamax.Complex umultiply(com.apamax.Complex b)Set this Complex number to multiply by the argument and return self.
com.apamax.Complex umultiplyReal(float b)Set this Complex number to be multiplied by the real argument and return self.
com.apamax.Complex unegate()Set this Complex number to its own negation and return self.
com.apamax.Complex ureciprocal()Set this Complex number to its own reciprocal and return self.
com.apamax.Complex usqrt()Set this Complex number to its square root and return self.
com.apamax.Complex usubtract(com.apamax.Complex b)Set this Complex number to subtract the argument and return self.
com.apamax.Complex static ZERO()Returns 0, represented as a complex number.
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |