infusion / Complex.js

Complex.js is a com numbers library written in JavaScript
https://raw.org/article/complex-numbers-in-javascript/
MIT License
232 stars 33 forks source link

complex.fromVector() ? #9

Closed Fil closed 7 years ago

Fil commented 7 years ago

There is a .toVector() method but no way to read in vector notation. Could this be added to the parse code at https://github.com/infusion/Complex.js/blob/master/complex.js#L150 ?

infusion commented 7 years ago

That's a pretty good idea, thanks. I just added this feature. I didn't bump the version and didn't push to npm yet, since there is some work going on. If you need this feature via npm, I'll add a new minor version.

Fil commented 7 years ago

Excellent, thanks! I'm currently using it via unpkg (see http://bl.ocks.org/Fil/1aafd8fa22b62243290674384c364dd0 ). But I can wait for a new release :)

You could add the [re,im] format in https://github.com/infusion/Complex.js/blob/master/complex.js#L17

infusion commented 7 years ago

Wow, the cox projection looks pretty cool! Okay, I'll add 2.0.4 in 10minutes or so.

I'll also add a comment on #L17.