Description
a simple complex number library
Examples
import Complex from 'simple-complex'
const z = new Complex(2, 3)
const ζ = new Complex(z)
const z = Complex.fromAngle(2, Math.PI)
const z = new Complex(1, 1)
const ζ = z.clone()
const z = new Complex()
z.set(2, 3)
const z = new Complex(4, 3)
const ζ = new Complex(1, 2)
const sum = Complex.sum(z, ζ)
const z = new Complex(0, 0)
const ζ = new Complex(1, 2)
z.add(ζ)
const z = new Complex(1, 3)
const ζ = new Complex(-4, 2)
const result = Complex.multiply(z, ζ)
const z = new Complex(1, 3)
const ζ = new Complex(-4, 2)
z.multiplyBy(ζ)
const z = new Complex(1, 0)
z.rotate(Math.PI / 2)
z.rotate(Math.PI / 2)
z.rotate(Math.PI / 2)
z.rotate(Math.PI / 2)
const ζ = new Complex(2, 2)
const { argument, modulus } = ζ
const z = new Complex(0, 0)
z.modulus = 10
z.argument = Math.PI / 2
const z = new Complex(1, 3)
const exponential = Complex.exp(z)
const square = Complex.square(z)
const z = Complex.fromAngle(2, 0)
const value = z.toString()