js-math-complex
js-math-complex copied to clipboard
Support operations over arrays
It would be nice to be able to do:
x = Math.Complex(1,2);
// Complex {re: 1, im: 2, …}
y = Math.Complex(2,3);
// Complex {re: 2, im: 3, …}
a = [x, y];
// [Complex {re: 1, im: 2, …}, Complex {re: 2, im: 3, …}]
Math.Complex.mul(a,2);
// [Complex {re: 2, im: 4, …}, Complex {re: 4, im: 6, …}]
Math.Complex.con(a);
// [Complex {re: 1, im: -2, …}, Complex {re: 2, im: -3, …}]