Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.