v2 update to type and method.
Updated:
conjugate(this)
Computes the conjugate of complex number by reversing the sign of the imaginary part.
Parameters:
this: complex.
Returns: Complex.
add(this, other)
Adds complex number other to this, in the form:
[_a.real + _b.real, _a.imaginary + _b.imaginary].
Parameters:
this: pseudo complex number in the form of a array [real, imaginary].
other: pseudo complex number in the form of a array [real, imaginary].
Returns: complex
subtract(this, other)
Subtract other from this, in the form:
[_a.real - _b.real, _a.imaginary - _b.imaginary].
Parameters:
this: complex.
other: complex.
Returns: complex
multiply(this, other)
Multiply this with other, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
this: complex.
other: complex.
Returns: complex
divide(this, other)
Divide complex_number _a with _b, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
this: complex.
other: complex.
Returns: complex
reciprocal(this)
Computes the reciprocal or inverse of complex_number.
Parameters:
this
Returns: complex
negative(this)
Negative of complex_number, in the form: [-_a.real, -_a.imaginary]
Parameters:
this
Returns: complex
inverse(this)
Inverse of complex_number, in the form: [1/_a.real, 1/_a.imaginary]
Parameters:
this
Returns: complex
exponential(this)
Exponential of complex_number.
Parameters:
this
Returns: complex
ceil(this, digits)
Ceils complex_number.
Parameters:
this
digits: int, digits to use as ceiling.
Returns: _complex: pseudo complex number in the form of a array [real, imaginary]
radius(this)
Radius(magnitude) of complex_number, in the form: [sqrt(pow(complex_number))]
This is defined as its distance from the origin (0,0) of the complex plane.
Parameters:
this
Returns: float value with radius.
magnitude(this)
magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
this
Returns: float.
magnitude_squared(this)
magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
this
Returns: float.
sign(this)
Unity of complex numbers.
Parameters:
this
Returns: float array, complex number.