RicardoSantos

MathComplexOperator

RicardoSantos Wizard 已更新   
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:
  • complex_number: float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

add(complex_number_a, complex_number_b) Adds complex number complex_number_b to complex_number_a, in the form:
.
Parameters:
  • complex_number_a: pseudo complex number in the form of a array .
  • complex_number_b: pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

subtract(complex_number_a, complex_number_b) Subtract complex_number_b from complex_number_a, in the form:
.
Parameters:
  • complex_number_a: float array, pseudo complex number in the form of a array .
  • complex_number_b: float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

multiply(complex_number_a, complex_number_b) Multiply complex_number_a with complex_number_b, in the form:

Parameters:
  • complex_number_a: float array, pseudo complex number in the form of a array .
  • complex_number_b: float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

divide(complex_number_a, complex_number_b) Divide complex_number _a with _b, in the form:

Parameters:
  • complex_number_a: float array, pseudo complex number in the form of a array .
  • complex_number_b: float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

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 .
Returns: float array, pseudo complex number in the form of a array

negative(complex_number) Negative of complex_number, in the form:
Parameters:
  • complex_number: float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

inverse(complex_number) Inverse of complex_number, in the form:
Parameters:
  • complex_number: float array, pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

exponential(complex_number) Exponential of complex_number.
Parameters:
  • complex_number: pseudo complex number in the form of a array .
Returns: float array, pseudo complex number in the form of a array

ceil(complex_number, digits) Ceils complex_number.
Parameters:
  • complex_number: float array, pseudo complex number in the form of a array .
  • digits: int, digits to use as ceiling.
Returns: _complex: pseudo complex number in the form of a array

radius(complex_number) Radius(magnitude) of complex_number, in the form:
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 .
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 .
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 .
Returns: float.

sign(complex_number) Unity of complex numbers.
Parameters:
  • complex_number: float array, pseudo complex number in the form of a array .
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:
.
  Parameters:
    this: pseudo complex number in the form of a array .
    other: pseudo complex number in the form of a array .
  Returns: complex

subtract(this, other)
  Subtract other from this, in the form:
.
  Parameters:
    this: complex.
    other: complex.
  Returns: complex

multiply(this, other)
  Multiply this with other, in the form:

  Parameters:
    this: complex.
    other: complex.
  Returns: complex

divide(this, other)
  Divide complex_number _a with _b, in the form:

  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:
  Parameters:
    this
  Returns: complex

inverse(this)
  Inverse of complex_number, in the form:
  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

radius(this)
  Radius(magnitude) of complex_number, in the form:
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.
Pine脚本库

本着真正的TradingView精神,作者将此Pine代码以开源脚本库发布,以便我们社区的其他Pine程序员可以重用它。向作者致敬!您可以私下或在其他开源出版物中使用此库,但在出版物中重用此代码受网站规则约束。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想使用这个脚本库吗?

复制以下行并将其粘贴到您的脚本中。