JavaScript Complex Math
This update has improved the performance of functions generated by Complex.parseFunction()
by attempting to compile sub-groups as constant expressions. For example:
(cos(0)+5i)*x
used to compile to the JavaScript
Complex.cos(Complex.ZERO).add(Complex(5,0).mult(Complex.I)).mult(x)
It now compiles simply to:
Complex(1,5).mult(x)
The compiler is now also case-sensitive, allowing differentiation between the variables a
and A
in an expression.
One minor update is the imaginary component of the Complex()
constructor is now optional.
Can now be more readily included in client-side environments using bower
and/or requirejs
.
The compiler has been updated to provide stricter compilation with more informative errors, and a minor bug-fix involving a misinterpretation during the parsing of any group of numbers in exponential format. Other updates:
rDivBy
and divBy
renamed torDiv
and div
respectfullyThis release now runs the library in strict mode for higher performance. The real operators rAdd
, rSub
, rMult
, rDivBy
, rMod
, and rPow
have been added. Two changes are NOT backwards compatible:
pow
is renamed to rPow
cPow
is renamed to pow
Though the previous release (1.1.1) is completely stable, this version has completely reformatted the code to be significantly more readable. One major update that is NOT backwards compatible:
Added Methods
Complex.prototype.equals
Complex.prototype.real
Complex.prototype.imag
Complex.prototype.abs
Complex.prototype.arg
Complex.norm
Complex.iPart
Removed with
statement from Complex.parseFunction
Removed all continue
statements
Added explicit block statements for all one-line if
, else
, for
, and while
statements to clarify control-flow
Documentation has been updated in uncompressed file to more standardized format. toString method now optimizes display of cartesian output.
Updated float parsing rules and added gamma and factorial functions to the library. Also stabilized generated function scopes in Node.js environment.