complex overview
A complex data of the shape: a + bi
which has a real component, and an imaginary component. Both are represented with Javascript’s 64-bit floating point numbers.
Added in v1.0.0
Table of contents
- Aliases
- Complex Ops
- Constructors
- Destructors
- Infix
- Instances
- Isomorphisms
- Matrix Operations
- Model
- Polynomial Operations
- Vector Operations
Aliases
add
Signature
export declare const add: (x: Complex, y: Complex) => Complex
Added in v1.0.0
div
Signature
export declare const div: (x: Complex, y: Complex) => Complex
Added in v1.0.0
mul
Signature
export declare const mul: (x: Complex, y: Complex) => Complex
Added in v1.0.0
sub
Signature
export declare const sub: (x: Complex, y: Complex) => Complex
Added in v1.0.0
Complex Ops
conj
Signature
export declare const conj: (c: Complex) => Complex
Added in v1.0.0
pow
Signature
export declare const pow: (c: Complex, n: number) => Complex
Added in v1.0.0
sqrt
Signature
export declare const sqrt: (c: Complex) => Complex
Added in v1.0.0
Constructors
fromPolarDegrees
Converts a polar-form complex tuple to Complex
Note, theta here is in degrees
Signature
export declare const fromPolarDegrees: (r: number, theta: number) => Complex
Added in v1.0.0
fromPolarRadians
Converts a polar-form complex tuple to Complex
Note, psi here is in radians
Signature
export declare const fromPolarRadians: (r: number, psi: number) => Complex
Added in v1.0.0
fromVector
Signature
export declare const fromVector: (v: V.Vec<2, number>) => Complex
Added in v1.0.0
of
Signature
export declare const of: (Re: number, Im: number) => Complex
Added in v1.0.0
one
Signature
export declare const one: Complex
Added in v1.0.0
onesN
Signature
export declare const onesN: <N extends number>(n: N) => Vec<N>
Added in v1.1.0
randComplex
Signature
export declare const randComplex: (min: number, max: number) => IO.IO<Complex>
Added in v1.0.0
scalar
Signature
export declare const scalar: (a: number) => Complex
Added in v1.0.0
zero
Signature
export declare const zero: Complex
Added in v1.0.0
zerosN
Signature
export declare const zerosN: <N extends number>(n: N) => Vec<N>
Added in v1.1.0
Destructors
argumentDegrees
Signature
export declare const argumentDegrees: (c: Complex) => O.Option<number>
Added in v1.0.0
argumentRadians
Signature
export declare const argumentRadians: (c: Complex) => O.Option<number>
Added in v1.0.0
modulus
Signature
export declare const modulus: (c: Complex) => number
Added in v1.0.0
toVector
Signature
export declare const toVector: (c: Complex) => V.Vec<2, number>
Added in v1.0.0
Infix
$_
Signature
export declare const $_: (s: Inf.FieldSymbol, x: Complex, y: Complex) => Complex
Added in v1.0.0
_
Signature
export declare const _: (a: Complex, s: Inf.FieldSymbol, b: Complex) => Complex
Added in v1.0.0
_$
Signature
export declare const _$: (a: Complex, b: Complex, s: Inf.FieldSymbol) => Complex
Added in v1.0.0
Instances
AdditiveAbGrpMN
Signature
export declare const AdditiveAbGrpMN: <M, N>(m: M, n: N) => TC.AbelianGroup<M.Mat<M, N, Complex>>
Added in v1.0.0
AdditiveAbGrpN
Signature
export declare const AdditiveAbGrpN: <N>(n: N) => TC.AbelianGroup<V.Vec<N, Complex>>
Added in v1.0.0
BiModMN
Signature
export declare const BiModMN: <M, N>(m: M, n: N) => TC.Bimodule<M.Mat<M, N, Complex>, Complex, Complex>
Added in v1.0.0
BiModN
Signature
export declare const BiModN: <N>(n: N) => TC.Bimodule<V.Vec<N, Complex>, Complex, Complex>
Added in v1.0.0
ComplexAdditiveAbelianGroup
Signature
export declare const ComplexAdditiveAbelianGroup: TC.AbelianGroup<Complex>
Added in v1.0.0
ComplexBimodule
Signature
export declare const ComplexBimodule: TC.Bimodule<Complex, number, number>
Added in v1.0.0
Eq
Signature
export declare const Eq: Eq_.Eq<Complex>
Added in v1.0.0
Field
Signature
export declare const Field: Fld.Field<Complex>
Added in v1.0.0
MagmaSub
Signature
export declare const MagmaSub: Mg.Magma<Complex>
Added in v1.0.0
MonoidProduct
Signature
export declare const MonoidProduct: Mn.Monoid<Complex>
Added in v1.0.0
MonoidProductMM
Signature
export declare const MonoidProductMM: <M>(m: M) => Mn.Monoid<M.Mat<M, M, Complex>>
Added in v1.1.0
MonoidSum
Signature
export declare const MonoidSum: Mn.Monoid<Complex>
Added in v1.0.0
PolynomialAdditiveAbelianGroup
Signature
export declare const PolynomialAdditiveAbelianGroup: TC.AbelianGroup<Poly.Polynomial<Complex>>
Added in v1.0.0
PolynomialBimodule
Signature
export declare const PolynomialBimodule: TC.Bimodule<Poly.Polynomial<Complex>, Complex, Complex>
Added in v1.0.0
PolynomialEuclidianRing
Signature
export declare const PolynomialEuclidianRing: TC.EuclidianRing<Poly.Polynomial<Complex>>
Added in v1.0.0
PolynomialRing
Signature
export declare const PolynomialRing: TC.CommutativeRing<Poly.Polynomial<Complex>>
Added in v1.0.0
SemigroupProduct
Signature
export declare const SemigroupProduct: Sg.Semigroup<Complex>
Added in v1.0.0
SemigroupSum
Signature
export declare const SemigroupSum: Sg.Semigroup<Complex>
Added in v1.0.0
Show
Signature
export declare const Show: Sh.Show<Complex>
Added in v1.0.0
getDifferentialAutomorphism
Signature
export declare const getDifferentialAutomorphism: (constantTerm: Complex) => Auto.Automorphism<Poly.Polynomial<Complex>>
Added in v1.0.0
Isomorphisms
IsoVector
Signature
export declare const IsoVector: Iso.Iso<Complex, V.Vec<2, number>>
Added in v1.0.0
Matrix Operations
addM
Add two matricies
Signature
export declare const addM: <M, N>(x: M.Mat<M, N, Complex>, y: M.Mat<M, N, Complex>) => M.Mat<M, N, Complex>
Added in v1.1.0
addV
Add two vectors
Signature
export declare const addV: <N>(x: V.Vec<N, Complex>, y: V.Vec<N, Complex>) => V.Vec<N, Complex>
Added in v1.1.0
idMat
Signature
export declare const idMat: <M>(m: M) => M.Mat<M, M, Complex>
Added in v1.0.0
linMap
Transform a column vector x
into vector b
by matrix A
Ax = b
Efficiency: 8mn
flops
Signature
export declare const linMap: <M, N1, N2>(A: M.Mat<M, N1, Complex>, x: V.Vec<N2, Complex>) => V.Vec<M, Complex>
Added in v1.0.0
linMapR
Transform a row-vector x
into vector b
by matrix A
xA = b
Efficiency: 8mn
flops
Signature
export declare const linMapR: <M, N1, N2>(x: V.Vec<N1, Complex>, A: M.Mat<N2, M, Complex>) => V.Vec<M, Complex>
Added in v1.1.0
mulM
Multiply two matricies with matching inner dimensions
(A ∈ R_mn) (B ∈ R_np) = C ∈ R_mp
Efficiency: (8mpn)
flops
Signature
export declare const mulM: <M, N1, N2, P>(x: M.Mat<M, N1, Complex>, y: M.Mat<N2, P, Complex>) => M.Mat<M, P, Complex>
Added in v1.0.0
subM
Subtract two matricies
Signature
export declare const subM: <M, N>(x: M.Mat<M, N, Complex>, y: M.Mat<M, N, Complex>) => M.Mat<M, N, Complex>
Added in v1.1.0
subV
Subtract two vectors
Signature
export declare const subV: <N>(x: V.Vec<N, Complex>, y: V.Vec<N, Complex>) => V.Vec<N, Complex>
Added in v1.1.0
trace
Signature
export declare const trace: <M>(fa: M.Mat<M, M, Complex>) => Complex
Added in v1.0.0
Model
Complex (interface)
Signature
export interface Complex {
readonly Re: number
readonly Im: number
}
Added in v1.0.0
Mat (type alias)
Signature
export type Mat<M, N> = M.Mat<M, N, Complex>
Added in v1.0.0
Vec (type alias)
Signature
export type Vec<N> = V.Vec<N, Complex>
Added in v1.0.0
Polynomial Operations
derivative
Signature
export declare const derivative: (coeffs: Poly.Polynomial<Complex>) => Poly.Polynomial<Complex>
Added in v1.0.0
evaluatePolynomial
Signature
export declare const evaluatePolynomial: (p: Poly.Polynomial<Complex>) => (x: Complex) => Complex
Added in v1.0.0
getAntiderivative
Signature
export declare const getAntiderivative: (
constantTerm: Complex
) => (p: Poly.Polynomial<Complex>) => Poly.Polynomial<Complex>
Added in v1.0.0
integrate
Signature
export declare const integrate: (lower: Complex, upper: Complex) => (p: Poly.Polynomial<Complex>) => Complex
Added in v1.0.0
polynomialInnerProduct
Signature
export declare const polynomialInnerProduct: (p: Poly.Polynomial<Complex>, q: Poly.Polynomial<Complex>) => Complex
Added in v1.0.0
polynomialNorm
Signature
export declare const polynomialNorm: (p: Poly.Polynomial<Complex>) => Complex
Added in v1.0.0
polynomialProjection
Signature
export declare const polynomialProjection: (
p: Poly.Polynomial<Complex>,
q: Poly.Polynomial<Complex>
) => Poly.Polynomial<Complex>
Added in v1.0.0
Vector Operations
cross
Signature
export declare const cross: (x: V.Vec<3, Complex>, y: V.Vec<3, Complex>) => V.Vec<3, Complex>
Added in v1.0.0
dot
Signature
export declare const dot: <N>(x: V.Vec<N, Complex>, y: V.Vec<N, Complex>) => Complex
Added in v1.0.0
l1Norm
Signature
export declare const l1Norm: <N>(x: V.Vec<N, Complex>) => Complex
Added in v1.0.0
l2Norm
Signature
export declare const l2Norm: <N>(x: V.Vec<N, Complex>) => Complex
Added in v1.0.0
lInfNorm
Signature
export declare const lInfNorm: (v: V.Vec<unknown, Complex>) => number
Added in v1.1.0
lpNorm
Signature
export declare const lpNorm: (p: number) => <N>(v: V.Vec<N, Complex>) => Complex
Added in v1.0.0
outerProduct
Signature
export declare const outerProduct: <M, N>(v1: V.Vec<M, Complex>, v2: V.Vec<N, Complex>) => M.Mat<M, N, Complex>
Added in v1.0.0
projection
Signature
export declare const projection: <N>(u: V.Vec<N, Complex>, v: V.Vec<N, Complex>) => V.Vec<N, Complex>
Added in v1.0.0