Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
imagine-node
Advanced tools
module to work with complex numbers
npm install imagine-node
const complex = new Complex(1, 1);
complex.toString() // 1+i
const chainingComplex = complex
.add({ real: 2, imaginary:3 })
.sub({ real: 1, imaginary:1 })
.multiply({ real: 2, imaginary:-3 })
.div({ real: 2, imaginary:3 });
assert(chainingComplex.real === 2);
assert(chainingComplex.imaginary === -3);ç
complex
.ln()
.multiply({ real:1, imaginary:1 })
.exp()
// Definitions and usage examples
cos() {
return this
.multiply({ imaginary:1 })
.exp()
.add(
this.multiply({ imaginary:-1 }).exp()
)
.div({ real:2 });
}
acos() {
return this
.add(this.pow(2).sub(1).sqrt()[0])
.ln()
.multiply(Complex.im(-1));
}
asin() {
return this
.multiply(Complex.im())
.add(Complex.re(1).sub(this.pow(2)).sqrt()[0])
.ln()
.multiply(Complex.im(-1));
}
atang() {
return Complex.re(1)
.sub(this.multiply(Complex.im()))
.ln()
.sub(Complex
.re(1)
.add(this.multiply(Complex.im()))
.ln()
)
.multiply(Complex.im(0.5));
}
sin() {
return this
.multiply({ imaginary:1 })
.exp()
.sub(
this.multiply({ imaginary:-1 }).exp()
)
.div({ imaginary: 2 });
}
return a complex number with only imaginary part equal to number given
return a complex number with only real part equal to number given
return a imaginary number
return a complex number with only imaginary part
return a complex number with only real part
FAQs
node module to work with complex numbers
The npm package imagine-node receives a total of 2 weekly downloads. As such, imagine-node popularity was classified as not popular.
We found that imagine-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.