root-of-unity
v1.0.0
Published
Root of unity calculation
Downloads
2
Maintainers
Readme
Root of unity
nth root of unity calculation using De Moivre's formula.
Install
$ npm install --save root-of-unity
Usage
The function expects an integer parameter greater than zero.
The result is an Array of Complex objects.
var rootOfUnity = require('root-of-unity');
rootOfUnity(3);
//=> [ { im: 0, real: 1 }, { im: 0.866, real: -0.5 }, { im: -0.8665, real: -0.5 } ]
License
root-of-unity is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.