Home Reference Source
import Complex from 'konpeito/src/math/Complex.mjs'
public class | source

Complex

複素数クラス (immutable)

Static Member Summary

Static Public Members
public static get

E: Complex: *

E

public static get

0.5

public static get

I: Complex: *

i, j

public static get

LN10

public static get

LN2: Complex: *

LN2

public static get

LOG10E

public static get

LOG2E

public static get

-1

public static get

負の無限大

public static get

NaN: Complex: *

非数

public static get

ONE: Complex: *

1

public static get

PI: Complex: *

PI

public static get

正の無限大

public static get

SQRT1_2

public static get

SQRT2

public static get

TEN: Complex: *

10

public static get

TWO: Complex: *

2

public static get

0

Static Method Summary

Static Public Methods
public static

create(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

Complex を作成

public static

ランダムな値を作成

public static

正規分布に従うランダムな値を作成

public static

valueOf(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

指定した数値から Complex 型に変換

Static Private Methods
private static

_toComplex(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

複素数を作成

private static

_toDouble(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): number

実数を作成

private static

_toInteger(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): number

整数を作成

Constructor Summary

Public Constructor
public

constructor(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object)

複素数を作成

Member Summary

Public Members
public get

arg: number: *

偏角

public get

doubleValue: number: *

64ビット実数に変換

public get

imag: number: *

虚部

public get

intValue: number: *

32ビット整数に変換

public get

norm: number: *

ノルム

public get

real: number: *

実部

Private Members
private

_im: number

虚部

private

_re: number

実部

Method Summary

Public Methods
public

絶対値

public

add(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

加算

public

atan

public

atan2(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

atan2

public

ceil

public

ディープコピー

public

compareTo(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): number

値同士を比較

public

共役複素数

public

cos

public

div(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

割り算

public

dot(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

ドット積

public

equals(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

等式

public

指数

public

整数化

public

floor

public

小数部の抽出

public

getDecimalPosition(): number

実部、虚部を表す際の小数点以下の桁数

public

逆数

public

isComplex(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

複素数を判定

public

isComplexInteger(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

複素整数を判定

public

isFinite(): boolean

有限数を判定

public

isInfinite(): boolean

無限を判定

public

isInteger(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

整数を判定

public

isNaN(): boolean

非数を判定

public

isNegative(): boolean

実部の負数を判定

public

isNotNegative(): boolean

実部の非負値を判定

public

isOne(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

1 を判定

public

isPositive(): boolean

実部の正数を判定

public

isReal(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

実数を判定

public

isZero(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean

0 を判定

public

対数

public

max(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

最大値

public

min(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

最小値

public

mod(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

割り算の正の余り

public

mul(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

乗算

public

負数

public

pow(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

累乗

public

四捨五入

public

符号値

public

sin

public

sinc

public

平方根

public

2乗

public

sub(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex

減算

public

tan

public

toString(): string

文字列データ

Static Public Members

public static get E: Complex: * source

E

Return:

Complex

2.71...

public static get HALF: Complex: * source

0.5

Return:

Complex

0.5

public static get I: Complex: * source

i, j

Return:

Complex

i

public static get LN10: Complex: * source

LN10

Return:

Complex

ln(10)

public static get LN2: Complex: * source

LN2

Return:

Complex

ln(2)

public static get LOG10E: Complex: * source

LOG10E

Return:

Complex

log_10(e)

public static get LOG2E: Complex: * source

LOG2E

Return:

Complex

log_2(e)

public static get MINUS_ONE: Complex: * source

-1

Return:

Complex

1

public static get NEGATIVE_INFINITY: Complex: * source

負の無限大

Return:

Complex

Inf

public static get NaN: Complex: * source

非数

Return:

Complex

NaN

public static get ONE: Complex: * source

1

Return:

Complex

1

public static get PI: Complex: * source

PI

Return:

Complex

3.14...

public static get POSITIVE_INFINITY: Complex: * source

正の無限大

Return:

Complex

Inf

public static get SQRT1_2: Complex: * source

SQRT1_2

Return:

Complex

sqrt(0.5)

public static get SQRT2: Complex: * source

SQRT2

Return:

Complex

sqrt(2)

public static get TEN: Complex: * source

10

Return:

Complex

10

public static get TWO: Complex: * source

2

Return:

Complex

2

public static get ZERO: Complex: * source

0

Return:

Complex

0

Static Public Methods

public static create(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

Complex を作成

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

public static rand(): Complex source

ランダムな値を作成

Return:

Complex

public static randn(): Complex source

正規分布に従うランダムな値を作成

Return:

Complex

public static valueOf(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

指定した数値から Complex 型に変換

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

Static Private Methods

private static _toComplex(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

複素数を作成

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

private static _toDouble(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): number source

実数を作成

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

number

private static _toInteger(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): number source

整数を作成

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

number

Public Constructors

public constructor(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object) source

複素数を作成

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

複素数( "1 + j", [1 , 1] など)

Public Members

public get arg: number: * source

偏角

Return:

number

arg(A)

public get doubleValue: number: * source

64ビット実数に変換

Return:

number

public get imag: number: * source

虚部

Return:

number

imag(A)

public get intValue: number: * source

32ビット整数に変換

Return:

number

public get norm: number: * source

ノルム

Return:

number

|A|

public get real: number: * source

実部

Return:

number

real(A)

Private Members

private _im: number source

虚部

private _re: number source

実部

Public Methods

public abs(): Complex source

絶対値

Return:

Complex

abs(A)

public add(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

加算

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

A + B

public atan(): Complex source

atan

Return:

Complex

atan(A)

public atan2(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

atan2

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional

実数で指定。省略時は、本オブジェクトの偏角を返す。

Return:

Complex

atan2(Y, X)

public ceil(): Complex source

ceil

Return:

Complex

ceil(A)

public clone(): Complex source

ディープコピー

Return:

Complex

public compareTo(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): number source

値同士を比較

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

number

A > B ? 1 : (A === B ? 0 : -1)

public conj(): Complex source

共役複素数

Return:

Complex

real(A) - imag(A)j

public cos(): Complex source

cos

Return:

Complex

cos(A)

public div(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

割り算

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

A / B

public dot(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

ドット積

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

A * conj(B)

public equals(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

等式

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

A === B

public exp(): Complex source

指数

Return:

Complex

exp(A)

public fix(): Complex source

整数化

Return:

Complex

fix(A)

public floor(): Complex source

floor

Return:

Complex

floor(A)

public fract(): Complex source

小数部の抽出

Return:

Complex

fract(A)

public getDecimalPosition(): number source

実部、虚部を表す際の小数点以下の桁数

Return:

number

小数点の桁数

public inv(): Complex source

逆数

Return:

Complex

1 / A

public isComplex(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

複素数を判定

Params:

NameTypeAttributeDescription
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

imag(A) !== 0

public isComplexInteger(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

複素整数を判定

Params:

NameTypeAttributeDescription
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

real(A) === 0 && imag(A) !== 0

public isFinite(): boolean source

有限数を判定

Return:

boolean

!isNaN(A) && !isInfinite(A)

public isInfinite(): boolean source

無限を判定

Return:

boolean

isInfinite(A)

public isInteger(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

整数を判定

Params:

NameTypeAttributeDescription
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

public isNaN(): boolean source

非数を判定

Return:

boolean

isNaN(A)

public isNegative(): boolean source

実部の負数を判定

Return:

boolean

real(x) < 0

public isNotNegative(): boolean source

実部の非負値を判定

Return:

boolean

real(x) >= 0

public isOne(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

1 を判定

Params:

NameTypeAttributeDescription
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

A === 1

public isPositive(): boolean source

実部の正数を判定

Return:

boolean

real(x) > 0

public isReal(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

実数を判定

Params:

NameTypeAttributeDescription
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

imag(A) === 0

public isZero(epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): boolean source

0 を判定

Params:

NameTypeAttributeDescription
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

boolean

A === 0

public log(): Complex source

対数

Return:

Complex

log(A)

public max(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

最大値

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

Complex

max([A, B])

public min(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object, epsilon: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

最小値

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object
epsilon Complex | number | string | Array<number> | {_re: number, _im: number} | Object
  • optional
  • default: Number.EPSILON

誤差を実数で指定

Return:

Complex

min([A, B])

public mod(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

割り算の正の余り

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

複素数を含まない数値

Return:

Complex

A mod B

public mul(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

乗算

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

A * B

public negate(): Complex source

負数

Return:

Complex

A

public pow(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

累乗

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

pow(A, B)

public round(): Complex source

四捨五入

Return:

Complex

round(A)

public sign(): Complex source

符号値

Return:

Complex

[-1,1] 複素数の場合はノルムを1にした値。

public sin(): Complex source

sin

Return:

Complex

sin(A)

public sinc(): Complex source

sinc

Return:

Complex

sinc(A)

public sqrt(): Complex source

平方根

Return:

Complex

sqrt(A)

public square(): Complex source

2乗

Return:

Complex

pow(A, 2)

public sub(number: Complex | number | string | Array<number> | {_re: number, _im: number} | Object): Complex source

減算

Params:

NameTypeAttributeDescription
number Complex | number | string | Array<number> | {_re: number, _im: number} | Object

Return:

Complex

A - B

public tan(): Complex source

tan

Return:

Complex

tan(A)

public toString(): string source

文字列データ

Return:

string