-
Notifications
You must be signed in to change notification settings - Fork 0
math.Complex.Class.Complex
dsp-collection / math/Complex / Complex
Defined in: math/Complex.ts:12
An immutable complex number.
new Complex(re, im?): Complex;Defined in: math/Complex.ts:56
Constructs a Complex.
number
The real part.
number = 0
The imaginary part. Optional. Default is 0.
Complex
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
im
|
readonly |
number |
Imaginary part of the complex number. | math/Complex.ts:44 |
re
|
readonly |
number |
Real part of the complex number. | math/Complex.ts:41 |
I
|
readonly |
Complex |
The imaginary unit i. | math/Complex.ts:19 |
INFINITY
|
readonly |
Complex |
A Complex representing "+Infinity + Infinity i" |
math/Complex.ts:34 |
NaN
|
readonly |
Complex |
A Complex representing "NaN + NaN i" |
math/Complex.ts:31 |
ONE
|
readonly |
Complex |
A Complex representing 1. |
math/Complex.ts:25 |
TWO
|
readonly |
Complex |
A Complex representing 2. |
math/Complex.ts:28 |
ZERO
|
readonly |
Complex |
A Complex representing 0. |
math/Complex.ts:22 |
abs(): number;Defined in: math/Complex.ts:128
Returns the absolute value (magnitude, vector length, radius).
number
add(x): Complex;Defined in: math/Complex.ts:201
Returns this + x;
Complex
Complex
addReal(x): Complex;Defined in: math/Complex.ts:195
Returns this + x;
number
Complex
arg(): number;Defined in: math/Complex.ts:134
Returns the argument (angle).
number
conj(): Complex;Defined in: math/Complex.ts:140
Returns the conjugate.
Complex
div(x): Complex;Defined in: math/Complex.ts:243
Returns this / x;
Complex
Complex
divReal(x): Complex;Defined in: math/Complex.ts:237
Returns this / x;
number
Complex
equals(x): boolean;Defined in: math/Complex.ts:99
Returns true if this complex number is exactly equal to another.
Complex
boolean
exp(): Complex;Defined in: math/Complex.ts:166
Returns the exponential function. (The Euler's number e raised to the power of this complex number).
Complex
fuzzyEquals(x, eps): boolean;Defined in: math/Complex.ts:106
Returns true if the real and imaginary parts of the two numbers
do not differ more than eps.
Complex
number
boolean
isFinite(): boolean;Defined in: math/Complex.ts:93
Returns true if the real and imaginary parts are both finite.
boolean
isInfinite(): boolean;Defined in: math/Complex.ts:87
Returns true if the real or the imaginary part is infinite (positive or negative).
boolean
isNaN(): boolean;Defined in: math/Complex.ts:81
Returns true if the real part or the imaginary part is NaN.
boolean
log(): Complex;Defined in: math/Complex.ts:172
Returns the natural logarithm (base e).
Complex
mul(x): Complex;Defined in: math/Complex.ts:231
Returns this * x;
Complex
Complex
mulReal(x): Complex;Defined in: math/Complex.ts:225
Returns this * x;
number
Complex
neg(): Complex;Defined in: math/Complex.ts:146
Returns the negation (-this).
Complex
pow(x): Complex;Defined in: math/Complex.ts:271
Returns this raised to the power of x.
Complex
Complex
powInt(x): Complex;Defined in: math/Complex.ts:257
Returns this raised to the power of x.
number
Complex
powReal(x): Complex;Defined in: math/Complex.ts:265
Returns this raised to the power of x.
number
Complex
reciprocal(): Complex;Defined in: math/Complex.ts:152
Returns the reciprocal (1 / this, multiplicative inverse).
Complex
sqr(): Complex;Defined in: math/Complex.ts:178
Returns the square.
Complex
sqrt(): Complex;Defined in: math/Complex.ts:184
Returns one of the two square roots.
Complex
sub(x): Complex;Defined in: math/Complex.ts:219
Returns this - x;
Complex
Complex
subReal(x): Complex;Defined in: math/Complex.ts:207
Returns this - x;
number
Complex
toNumber(eps): number;Defined in: math/Complex.ts:72
Returns the real part.
Verifies that abs(im) <= eps or abs(im) <= abs(re) * eps.
number
number
toString(): string;Defined in: math/Complex.ts:65
Returns a string representing the complex number.
string
static divFromReal(x, y): Complex;Defined in: math/Complex.ts:250
Returns x / y;
number
Complex
Complex
static expj(arg): Complex;Defined in: math/Complex.ts:114
Creates a Complex of length 1 and argument arg.
number
Complex
static fromPolar(abs, arg): Complex;Defined in: math/Complex.ts:120
Creates a Complex from polar coordinates.
number
number
Complex
static subFromReal(x, y): Complex;Defined in: math/Complex.ts:213
Returns x - y;
number
Complex
Complex