[API](/solutions/geotoolkit/geotoolkit_js/apis/readme) / [geotoolkit](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit) / [seismic](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.seismic) / [analysis](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.seismic#analysis) / [maths](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.seismic#maths) / [ComplexArray](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.seismic#complexarray) / ComplexArray

# Class: ComplexArray

[maths](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.seismic#maths).[ComplexArray](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit.seismic#complexarray).ComplexArray

<p>An array of complex numbers.</p>

<p>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. </p>

This is a wrapper class that can hold two double arrays, one of which is
interpreted as containing the real values, the other the imaginary values
of the complex numbers.
Ported from the Saddleback Geosolution's Java implementation

## Table of contents

Constructors
| [new ComplexArray(real)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray.md#new complexarray(real)) | [new ComplexArray(real, imag)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray.md#new complexarray(real, imag)) |
|  --- | --- |


Methods
| [get](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#get) | [getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#getclassname) | [getImagArray](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#getimagarray) |
|  --- | --- | --- |
| [getLength](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#getlength) | [getRealArray](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#getrealarray) | [set](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#set) |
| [getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray#getclassname-1) |


## Contents

Constructors
#### new ComplexArray(real)

• **new ComplexArray**(`real`)

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `real` | `number` | `Float32Array` | [`ComplexArray`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray) | complex array or length |


#### new ComplexArray(real, imag)

• **new ComplexArray**(`real`, `imag`)

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `real` | `Float32Array` | Real part of the complex array. |
| `imag` | `Float32Array` | The imaginary part of the complex array. |


Methods
#### get

▸ **get**(`index`): [`ComplexNumber`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexnumber.complexnumber)

Gets a new ComplexNumber from the ComplexArray at a specified index

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `index` | `number` | The index location at which to get the complex number. |


#### Returns

[`ComplexNumber`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexnumber.complexnumber)

complex The complex number.

#### getClassName

▸ **getClassName**(): `string`

#### Returns

`string`

#### getImagArray

▸ **getImagArray**(): `Float32Array`

Gets the array of imaginary components.

#### Returns

`Float32Array`

imagArray The imaginary data array.

#### getLength

▸ **getLength**(): `number`

Gets the length of the complex array.

#### Returns

`number`

length The length of the complex array.

#### getRealArray

▸ **getRealArray**(): `Float32Array`

Gets the array of real components.

#### Returns

`Float32Array`

realArray The real data array.

#### set

▸ **set**(`complexNumber`, `index`): [`ComplexArray`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray)

Set the value of ComplexArray at a specified index with the ComplexNumber complexNumber.

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `complexNumber` | [`ComplexNumber`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexnumber.complexnumber) | The complex number. |
| `index` | `number` | The index at which the complex number will be set. |


#### Returns

[`ComplexArray`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit.seismic.analysis.maths.complexarray.complexarray)

this

#### getClassName

▸ `Static` **getClassName**(): `string`

#### Returns

`string`