Skip to content
Last updated

API / geotoolkit / seismic / analysis / maths / ComplexNumber / ComplexNumber

Class: ComplexNumber

maths.ComplexNumber.ComplexNumber

A complex number, C, has the form C = A + B*j, where A and B are both real. We refer to A as the 'real part' of C, and B as the 'imaginary part' of C where both A and B can be represented by double precision values. Ported from the Saddleback Geosolution's Java implementation

Table of contents

Constructors
[new ComplexNumber(num)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.seismic.analysis.maths.complexnumber.complexnumber.md#new complexnumber(num))[new ComplexNumber(real, imag)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.seismic.analysis.maths.complexnumber.complexnumber.md#new complexnumber(real, imag))
Methods

Contents

Constructors

new ComplexNumber(num)

• new ComplexNumber(num)

Parameters

Name Type
numComplexNumber

new ComplexNumber(real, imag)

• new ComplexNumber(real, imag)

Parameters

Name Type Description
realnumberReal part of the complex value denoted by A in the expression C = A + B*j
imagnumberThe imaginary component Imaginary part of the complex value denoted by B in the expression C = A + B*j
Methods

getClassName

▸ getClassName(): string

Returns

string


getImag

▸ getImag(): number

Gets the imaginary value of the complex number.

Returns

number

imag The imaginary component.


getReal

▸ getReal(): number

Gets the real value of the complex number.

Returns

number

real The real component.


setImag

▸ setImag(imag): ComplexNumber

Sets the imaginary value of the complex number.

Parameters

Name Type Description
imagnumberThe imaginary component.

Returns

ComplexNumber

this


setReal

▸ setReal(real): ComplexNumber

Sets the real value of the complex number.

Parameters

Name Type Description
realnumberThe real component

Returns

ComplexNumber

this


toString

▸ toString(): string

Gets the string representation of this complex number.

Returns

string

stringValue The string value of the complex number.


getClassName

▸ Static getClassName(): string

Returns

string