PINE LIBRARY
업데이트됨 MathComplexOperator

Library "MathComplexOperator"
A set of utility functions to handle complex numbers.
conjugate(complex_number) Computes the conjugate of complex_number by reversing the sign of the imaginary part.
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
add(complex_number_a, complex_number_b) Adds complex number complex_number_b to complex_number_a, in the form:
[_a.real + _b.real, _a.imaginary + _b.imaginary].
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
subtract(complex_number_a, complex_number_b) Subtract complex_number_b from complex_number_a, in the form:
[_a.real - _b.real, _a.imaginary - _b.imaginary].
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
multiply(complex_number_a, complex_number_b) Multiply complex_number_a with complex_number_b, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
divide(complex_number_a, complex_number_b) Divide complex_number _a with _b, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
reciprocal(complex_number) Computes the reciprocal or inverse of complex_number.
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
negative(complex_number) Negative of complex_number, in the form: [-_a.real, -_a.imaginary]
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
inverse(complex_number) Inverse of complex_number, in the form: [1/_a.real, 1/_a.imaginary]
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
exponential(complex_number) Exponential of complex_number.
Parameters:
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
ceil(complex_number, digits) Ceils complex_number.
Parameters:
Returns: _complex: pseudo complex number in the form of a array [real, imaginary]
radius(complex_number) Radius(magnitude) of complex_number, in the form: [sqrt(pow(complex_number))]
This is defined as its distance from the origin (0,0) of the complex plane.
Parameters:
Returns: float value with radius.
magnitude(complex_number) magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
Returns: float.
magnitude_squared(complex_number) magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
Returns: float.
sign(complex_number) Unity of complex numbers.
Parameters:
Returns: float array, complex number.
A set of utility functions to handle complex numbers.
conjugate(complex_number) Computes the conjugate of complex_number by reversing the sign of the imaginary part.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
add(complex_number_a, complex_number_b) Adds complex number complex_number_b to complex_number_a, in the form:
[_a.real + _b.real, _a.imaginary + _b.imaginary].
Parameters:
- complex_number_a: pseudo complex number in the form of a array [real, imaginary].
- complex_number_b: pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
subtract(complex_number_a, complex_number_b) Subtract complex_number_b from complex_number_a, in the form:
[_a.real - _b.real, _a.imaginary - _b.imaginary].
Parameters:
- complex_number_a: float array, pseudo complex number in the form of a array [real, imaginary].
- complex_number_b: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
multiply(complex_number_a, complex_number_b) Multiply complex_number_a with complex_number_b, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
- complex_number_a: float array, pseudo complex number in the form of a array [real, imaginary].
- complex_number_b: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
divide(complex_number_a, complex_number_b) Divide complex_number _a with _b, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
- complex_number_a: float array, pseudo complex number in the form of a array [real, imaginary].
- complex_number_b: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
reciprocal(complex_number) Computes the reciprocal or inverse of complex_number.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
negative(complex_number) Negative of complex_number, in the form: [-_a.real, -_a.imaginary]
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
inverse(complex_number) Inverse of complex_number, in the form: [1/_a.real, 1/_a.imaginary]
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
exponential(complex_number) Exponential of complex_number.
Parameters:
- complex_number: pseudo complex number in the form of a array [real, imaginary].
Returns: float array, pseudo complex number in the form of a array [real, imaginary]
ceil(complex_number, digits) Ceils complex_number.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
- digits: int, digits to use as ceiling.
Returns: _complex: pseudo complex number in the form of a array [real, imaginary]
radius(complex_number) Radius(magnitude) of complex_number, in the form: [sqrt(pow(complex_number))]
This is defined as its distance from the origin (0,0) of the complex plane.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float value with radius.
magnitude(complex_number) magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float.
magnitude_squared(complex_number) magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float.
sign(complex_number) Unity of complex numbers.
Parameters:
- complex_number: float array, pseudo complex number in the form of a array [real, imaginary].
Returns: float array, complex number.
릴리즈 노트
v2 update to type and method.Updated:
conjugate(this)
Computes the conjugate of complex number by reversing the sign of the imaginary part.
Parameters:
this: complex.
Returns: Complex.
add(this, other)
Adds complex number other to this, in the form:
[_a.real + _b.real, _a.imaginary + _b.imaginary].
Parameters:
this: pseudo complex number in the form of a array [real, imaginary].
other: pseudo complex number in the form of a array [real, imaginary].
Returns: complex
subtract(this, other)
Subtract other from this, in the form:
[_a.real - _b.real, _a.imaginary - _b.imaginary].
Parameters:
this: complex.
other: complex.
Returns: complex
multiply(this, other)
Multiply this with other, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
this: complex.
other: complex.
Returns: complex
divide(this, other)
Divide complex_number _a with _b, in the form:
[(_a.real * _b.real) - (_a.imaginary * _b.imaginary), (_a.real * _b.imaginary) + (_a.imaginary * _b.real)]
Parameters:
this: complex.
other: complex.
Returns: complex
reciprocal(this)
Computes the reciprocal or inverse of complex_number.
Parameters:
this
Returns: complex
negative(this)
Negative of complex_number, in the form: [-_a.real, -_a.imaginary]
Parameters:
this
Returns: complex
inverse(this)
Inverse of complex_number, in the form: [1/_a.real, 1/_a.imaginary]
Parameters:
this
Returns: complex
exponential(this)
Exponential of complex_number.
Parameters:
this
Returns: complex
ceil(this, digits)
Ceils complex_number.
Parameters:
this
digits: int, digits to use as ceiling.
Returns: _complex: pseudo complex number in the form of a array [real, imaginary]
radius(this)
Radius(magnitude) of complex_number, in the form: [sqrt(pow(complex_number))]
This is defined as its distance from the origin (0,0) of the complex plane.
Parameters:
this
Returns: float value with radius.
magnitude(this)
magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
this
Returns: float.
magnitude_squared(this)
magnitude(absolute value) of complex_number, should be the same as the radius.
Parameters:
this
Returns: float.
sign(this)
Unity of complex numbers.
Parameters:
this
Returns: float array, complex number.
릴리즈 노트
v3 minor update.파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.