Complex Number object.
More...
|
| __construct ($realPart=0.0, $imaginaryPart=null, $suffix='i') |
|
| __call ($functionName, $arguments) |
| Returns the result of the function call or operation.
|
|
| __toString () |
|
| format () |
|
| getImaginary () |
| Gets the imaginary part of this complex number.
|
|
| getReal () |
| Gets the real part of this complex number.
|
|
| getSuffix () |
| Gets the suffix of this complex number.
|
|
| invertImaginary () |
|
| invertReal () |
|
| isComplex () |
| Returns true if this is a complex value, false if a real value.
|
|
| isReal () |
| Returns true if this is a real value, false if a complex value.
|
|
| reverse () |
| Returns the reverse of this complex number.
|
|
|
static | validateComplexArgument ($complex) |
| Validates whether the argument is a valid complex number, converting scalar or array values if possible.
|
|
|
const | EULER = 2.7182818284590452353602874713526624977572 |
| @constant Euler's Number.
|
|
const | NUMBER_SPLIT_REGEXP |
| @constant Regexp to split an input string into real and imaginary components and suffix
|
|
|
float | $imaginaryPart = 0.0 |
| $imaginaryPart The value of of this complex number on the imaginary plane.
|
|
float | $realPart = 0.0 |
| $realPart The value of of this complex number on the real plane.
|
|
string | $suffix |
| $suffix The suffix for this complex number (i or j).
|
|
Complex Number object.
@method float abs() @method Complex acos() @method Complex acosh() @method Complex acot() @method Complex acoth() @method Complex acsc() @method Complex acsch() @method float argument() @method Complex asec() @method Complex asech() @method Complex asin() @method Complex asinh() @method Complex atan() @method Complex atanh() @method Complex conjugate() @method Complex cos() @method Complex cosh() @method Complex cot() @method Complex coth() @method Complex csc() @method Complex csch() @method Complex exp() @method Complex inverse() @method Complex ln() @method Complex log2() @method Complex log10() @method Complex negative() @method Complex pow(int|float $power) @method float rho() @method Complex sec() @method Complex sech() @method Complex sin() @method Complex sinh() @method Complex sqrt() @method Complex tan() @method Complex tanh() @method float theta() @method Complex add(...$complexValues) @method Complex subtract(...$complexValues) @method Complex multiply(...$complexValues) @method Complex divideby(...$complexValues) @method Complex divideinto(...$complexValues)
◆ __call()
Complex::__call |
( |
| $functionName, |
|
|
| $arguments ) |
Returns the result of the function call or operation.
- Return values
-
- Exceptions
-
Exception|InvalidArgumentException | |
◆ getImaginary()
Complex::getImaginary |
( |
| ) |
|
Gets the imaginary part of this complex number.
- Return values
-
◆ getReal()
Gets the real part of this complex number.
- Return values
-
◆ getSuffix()
Gets the suffix of this complex number.
- Return values
-
◆ isComplex()
Returns true if this is a complex value, false if a real value.
- Return values
-
◆ isReal()
Returns true if this is a real value, false if a complex value.
- Return values
-
◆ reverse()
Returns the reverse of this complex number.
- Return values
-
◆ validateComplexArgument()
static Complex::validateComplexArgument |
( |
| $complex | ) |
|
|
static |
Validates whether the argument is a valid complex number, converting scalar or array values if possible.
- Parameters
-
mixed | $complex | The value to validate |
- Return values
-
- Exceptions
-
◆ $operations
Initial value:= [
'add',
'subtract',
'multiply',
'divideby',
'divideinto',
]
◆ NUMBER_SPLIT_REGEXP
const Complex::NUMBER_SPLIT_REGEXP |
Initial value:=
'` ^
( # Real part
[-+]?(\d+\.?\d*|d*::.?::d+) # Real value (integer or float)
([Ee][-+]?[0-2]?\d{1,3})? # Optional real exponent for scientific format
)
( # Imaginary part
[-+]?(\d+\.?\d*|d*::.?::d+) # Imaginary value (integer or float)
([Ee][-+]?[0-2]?\d{1,3})? # Optional imaginary exponent for scientific format
)?
( # Imaginary part is optional
([-+]?) # Imaginary (implicit 1 or -1) only
([ij]?) # Imaginary i or j - depending on whether mathematical or engineering
)
$`uix'
@constant Regexp to split an input string into real and imaginary components and suffix
The documentation for this class was generated from the following file:
- lib/phpspreadsheet/markbaker/complex/classes/src/Complex.php