Home Manual Reference Source Test Repository

Installation

Installation

Can be managed using jspm or npm.

jspm

jspm install npm:@aureooms/js-complex

npm

npm install @aureooms/js-complex --save

Usage

Usage

The code needs a ES2015+ polyfill to work, for example babel-polyfill.

require( 'babel-polyfill' ) ;
// or
import 'babel-polyfill' ;

Then

const complex = require( '@aureooms/js-complex' ) ;
// or
import * as complex from '@aureooms/js-complex' ;

Example

Example

import * as number from '@aureooms/js-number' ;
import { cartesian } from '@aureooms/js-complex' ;
let kernel = cartesian.kernel.compile( number , 'i' ) ;
let { add , sub , mul , div } = cartesian.array.compile( kernel ) ;

References

References

Class Summary

Static Public Class Summary
public
public
public

Function Summary

Static Public Function Summary
public

$(kernel: *)

public

$0(): *

public

$0($0: *)

public

$1($0: *, $1: *)

public

$1(): *

public

Complex(a: *, b: *)

public

Complex(a: *, b: *)

public

abs(sqrt: *, pow2: *, add: *)

Computes the absolute value (or modulus or magnitude) of the complex number a + bi.

public

add(first: *, second: *): *

public

add(add: *)

Addition algorithm.

public

arg(atan2: *)

Computes the argument of the complex number a + bi.

public

binary(kernel: *)

public

binary(kernel: *)

public

binary(kernel: *)

public

binary(kernel: *)

public

compile(objectPattern: {"add": *, "sub": *, "mul": *, "div": *, "neg": *, "cos": *, "sin": *}, symbol: *): {"mul": *, "div": *, "real": *, "img": *, "con": *}

public

compile(objectPattern: {"add": *, "sub": *, "mul": *, "div": *, "div2": *, "div2n": *, "neg": *, "sqrt": *, "pow2": *, "exp": *, "loge": *, "PI": *, "cos": *, "sin": *, "atan2": *, "parse": *, "stringify": *, "$0": *, "$1": *, "$_1": *, "eq0": *, "eq1": *, "eq_1": *, "gt0": *}, symbol: *): {"$0": *, "$1": *, "root2n": *, "iroot2n": *, "add": *, "sub": *, "mul": *, "imul": *, "div": *, "div2": *, "abs": *, "arg": *, "con": *, "parse": *, "stringify": *, "exp": *, "pow": *}

public

compile(objectPattern: {"mul": *, "div": *, "real": *, "img": *, "con": *}, symbol: *): {"complex": *, "mul": *, "div": *, "real": *, "img": *, "con": *}

public

compile(objectPattern: {"$0": *, "$1": *, "root2n": *, "iroot2n": *, "add": *, "sub": *, "mul": *, "div": *, "imul": *, "div2": *, "abs": *, "arg": *, "con": *, "parse": *, "stringify": *, "exp": *, "pow": *}, symbol: *): {"complex": *, "$0": *, "$1": *, "root2n": *, "iroot2n": *, "add": *, "sub": *, "mul": *, "imul": *, "div": *, "div2": *, "abs": *, "arg": *, "con": *, "parse": *, "stringify": *, "exp": *, "pow": *}

public

compile(objectPattern: {"$0": *, "$1": *, "root2n": *, "iroot2n": *, "add": *, "sub": *, "mul": *, "div": *, "imul": *, "div2": *, "abs": *, "arg": *, "con": *, "parse": *, "stringify": *, "exp": *, "pow": *}, symbol: *): {"complex": *, "$0": *, "$1": *, "root2n": *, "iroot2n": *, "add": *, "sub": *, "mul": *, "imul": *, "div": *, "div2": *, "abs": *, "arg": *, "con": *, "parse": *, "stringify": *, "exp": *, "pow": *}

public

compile(objectPattern: {"mul": *, "div": *, "real": *, "img": *, "con": *}, symbol: *): {"complex": *, "mul": *, "div": *, "real": *, "img": *, "con": *}

public

complex(a: *, b: *)

public

complex(a: *, b: *)

public

complex(a: *, b: *)

public

complex(a: *, b: *)

public

con(neg: *)

Conjugate for polar representation

public

con(neg: *)

Conjugate for cartesian representation

public

div(div: *, sub: *)

public

div(first: *, second: *): *

public

div(div: *, pow2: *, mul: *, add: *, sub: *): undefined[]

Division algorithm

public

div2(div2: *)

public

exp(exp: *, cos: *, sin: *, mul: *)

public

fromarray(arrayPattern: *[])

public

fromarray(arrayPattern: *[])

public

iadd(first: *, second: *): *

public

idiv(first: *, second: *): *

public

img(kernel: *)

public

img(mul: *, sin: *)

public

img(kernel: *)

public

imod(first: *, second: *): *

public

imul(first: *, second: *): *

public

ipow(first: *, second: *): *

public

iroot2n(cos: *, sin: *, pi: *, div2n: *, neg: *)

public

isub(first: *, second: *): *

public

mod(first: *, second: *): *

public

mul(mul: *, add: *, sub: *)

Multiplication algorithm

public

mul(mul: *, add: *)

public

mul(first: *, second: *): *

public

parse(object: *, representation: *): *

public

parse(parse: *, $0: *, $1: *, $_1: *, symbol: *): *

Parse

public

parse(kernel: *)

public

pow(first: *, second: *): *

public

pow(exp: *, abs: *, arg: *, loge: *, mul: *, sub: *, add: *): *

public

real(kernel: *)

public

real(mul: *, cos: *)

public

real(kernel: *)

public

root2n(kernel: *)

public

root2n(cos: *, sin: *, pi: *, div2n: *)

public

stringify(kernel: *)

public

stringify(complex: *, representation: *): *

public

stringify(stringify: *, eq0: *, eq1: *, eq_1: *, gt0: *, symbol: *): *

Stringify

public

sub(first: *, second: *): *

public

unary(kernel: *)

public

unary(kernel: *)

public

unary(kernel: *)

public

unary(kernel: *)