js-math-complex icon indicating copy to clipboard operation
js-math-complex copied to clipboard

Support operations over arrays

Open waldyrious opened this issue 12 years ago • 0 comments

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, …}]

waldyrious avatar Nov 26 '13 23:11 waldyrious