Link Search Menu Expand Document

Complex

complex.ts#L18

Class Complex

Complex number class.

constructor (re: number, im: number): Complex

Name Type Default Description
re number 0  
im number 0  

Property .im : number

Default value: 0

Property .re : number

Default value: 0

Accessor .argument : number

Accessor .conjugate : Complex

Accessor .modulus : number

Method .add (a: number|Complex): Complex

Name Type Default Description  
a number Complex    

Method .divide (a: number|Complex): Complex

Name Type Default Description  
a number Complex    

Method .multiply (a: number|Complex): Complex

Name Type Default Description  
a number Complex    

Method .root (n: number, i: number): Complex

Returns the ith nth-root of this complex number.

Name Type Default Description
n number    
i number 0  

Method .subtract (a: number|Complex): Complex

Name Type Default Description  
a number Complex    

Method .toString (precision: number): string

Name Type Default Description
precision number 2  

static Method .difference (c1: number|Complex, c2: number|Complex): Complex

Calculates the difference of two complex numbers c1 and c2.

Name Type Default Description  
c1 number Complex    
c2 number Complex    

static Method .exp (c: number|Complex): Complex

Calculates e^c for a complex number c.

Name Type Default Description  
c number Complex    

static Method .product (c1: number|Complex, c2: number|Complex): Complex

Calculates the product of two complex numbers c1 and c2.

Name Type Default Description  
c1 number Complex    
c2 number Complex    

static Method .quotient (c1: number|Complex, c2: number|Complex): Complex

Calculates the quotient of two complex numbers c1 and c2.

Name Type Default Description  
c1 number Complex    
c2 number Complex    

static Method .sum (c1: number|Complex, c2: number|Complex): Complex

Calculates the sum of two complex numbers c1 and c2.

Name Type Default Description  
c1 number Complex    
c2 number Complex    

Copyright © 2021 Mathigon.org