Simple complex numbers arithmetic operations
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.npmignore
LICENSE
README.md
package.json
test.js

README.md

Complexo

Simple complex numbers arithmetic operations.

Installation

Via npm on Node:

npm install complexo

Usage

Reference in your program:

var cx = require('complexo');

Usage

// create number 3 + 4i
var cnumber = cx.complex(3, 4);
// toString
cnumber.toString(); // "3 + 4i"
// inverse
cnumber.inv();
// add to cnumber
var newcnumber = cnumber.add(cnumber2);
// subtract cnumber
newcnumber = cnumber.sub(cnumber2);
// multiply cnumber
newcnumber = cnumber.mult(cnumber2);
// divide cnumber
newcnumber = cnumber.div(cnumber2);
// conjugate
newcnumber = cnumber.conj();

Development

git clone git://github.com/ajlopez/Complexo.git
cd Complexo
npm install
npm test

Versions

  • 0.0.1 Published
  • 0.0.2 Published, using complex factory function

Samples

TBD

License

MIT

Contribution

Feel free to file issues and submit pull requests — contributions are welcome<

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.