Implementation of complex number arithmetic with the standard transcendental functions.
More...
|
static | parse ($value) |
| convert data to a complex number, if possible More...
|
|
static | create ($real, $imag) |
| create a complex number from its real and imaginary parts More...
|
|
static | add ($z, $w) |
| add two complex numbers More...
|
|
static | sub ($z, $w) |
| subtract two complex numbers More...
|
|
static | mul ($z, $w) |
| multiply two complex numbers More...
|
|
static | div ($z, $w) |
| divide two complex numbers More...
|
|
static | pow ($z, $w) |
| powers of two complex numbers More...
|
|
static | sin ($z) |
| complex sine function More...
|
|
static | cos ($z) |
| complex cosine function More...
|
|
static | tan ($z) |
| complex tangent function More...
|
|
static | cot ($z) |
| complex cotangent function More...
|
|
static | arcsin ($z) |
| complex inverse sine function More...
|
|
static | arccos ($z) |
| complex inverse cosine function More...
|
|
static | arctan ($z) |
| complex inverse tangent function More...
|
|
static | arccot ($z) |
| complex inverse cotangent function More...
|
|
static | exp ($z) |
| complex exponential function More...
|
|
static | log ($z) |
| complex logarithm function More...
|
|
static | sinh ($z) |
| complex hyperbolic sine function More...
|
|
static | cosh ($z) |
| complex hyperbolic cosine function More...
|
|
static | tanh ($z) |
| complex hyperbolic tangent function More...
|
|
static | arsinh ($z) |
| complex inverse hyperbolic sine function More...
|
|
static | arcosh ($z) |
| complex inverse hyperbolic cosine function More...
|
|
static | artanh ($z) |
| complex inverse hyperbolic tangent function More...
|
|
static | sqrt ($z) |
| complex square root function More...
|
|
|
static | isSignedReal ($value) |
| check whether a string represents a signed real number More...
|
|
static | parseReal ($value) |
| convert string to floating point number, if possible More...
|
|
static | toFloat ($x) |
| convert data to a floating point number, if possible More...
|
|
static | powi ($z, $n) |
| integer power of a complex number More...
|
|
|
| $x |
| float $x real part
|
|
| $y |
| float $y real part
|
|
Implementation of complex number arithmetic with the standard transcendental functions.
Example:
$z = new Complex(3, 4);
$w = new Complex(-1, 1);
MathParser\Extensions\Complex::__construct |
( |
|
$real, |
|
|
|
$imag |
|
) |
| |
Constructor.
Construct a complex number with given real and imaginary part
- Parameters
-
float | $real | real part |
float | $imag | imaginary part |
MathParser\Extensions\Complex::__toString |
( |
| ) |
|
string representation of a complex number
- Parameters
-
- Return values
-
MathParser\Extensions\Complex::abs |
( |
| ) |
|
Modulus (absolute value)
Return the modulus of the complex number z=x+iy, i.e. sqrt(x^2 + y^2)
- Return values
-
static MathParser\Extensions\Complex::add |
( |
|
$z, |
|
|
|
$w |
|
) |
| |
|
static |
add two complex numbers
Complex::add($z, $w) computes and returns $z+$w
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::arccos |
( |
|
$z | ) |
|
|
static |
complex inverse cosine function
Complex::arccos($z) computes and returns the principal branch of arccos($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::arccot |
( |
|
$z | ) |
|
|
static |
complex inverse cotangent function
Complex::arccot($z) computes and returns the principal branch of arccot($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::arcosh |
( |
|
$z | ) |
|
|
static |
complex inverse hyperbolic cosine function
Complex::arcosh($z) computes and returns the principal branch of arcosh($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::arcsin |
( |
|
$z | ) |
|
|
static |
complex inverse sine function
Complex::arcsin($z) computes and returns the principal branch of arcsin($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::arctan |
( |
|
$z | ) |
|
|
static |
complex inverse tangent function
Complex::arctan($z) computes and returns the principal branch of arctan($z)
- Parameters
-
- Return values
-
MathParser\Extensions\Complex::arg |
( |
| ) |
|
Argument (principal value)
Returns the prinicpal argument of the complex number, i.e. a number t with -pi < t <= pi, such that z = rexp(i*t) for some positive real r
- Return values
-
static MathParser\Extensions\Complex::arsinh |
( |
|
$z | ) |
|
|
static |
complex inverse hyperbolic sine function
Complex::arsinh($z) computes and returns the principal branch of arsinh($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::artanh |
( |
|
$z | ) |
|
|
static |
complex inverse hyperbolic tangent function
Complex::artanh($z) computes and returns the principal branch of artanh($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::cos |
( |
|
$z | ) |
|
|
static |
complex cosine function
Complex::cos($z) computes and returns cos($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::cosh |
( |
|
$z | ) |
|
|
static |
complex hyperbolic cosine function
Complex::cosh($z) computes and returns cosh($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::cot |
( |
|
$z | ) |
|
|
static |
complex cotangent function
Complex::cot($z) computes and returns cot($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::create |
( |
|
$real, |
|
|
|
$imag |
|
) |
| |
|
static |
create a complex number from its real and imaginary parts
- Parameters
-
- Exceptions
-
SyntaxErrorException | if the string cannot be parsed |
- Return values
-
static MathParser\Extensions\Complex::div |
( |
|
$z, |
|
|
|
$w |
|
) |
| |
|
static |
divide two complex numbers
Complex::div($z, $w) computes and returns $z/$w
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::exp |
( |
|
$z | ) |
|
|
static |
complex exponential function
Complex::exp($z) computes and returns exp($z)
- Parameters
-
- Return values
-
MathParser\Extensions\Complex::i |
( |
| ) |
|
Imaginary part.
- Return values
-
MathParser\Extensions\Complex::is_nan |
( |
| ) |
|
test if the complex number is NAN
- Return values
-
static MathParser\Extensions\Complex::isSignedReal |
( |
|
$value | ) |
|
|
staticprivate |
check whether a string represents a signed real number
- Parameters
-
- Return values
-
bool | true if $value is a signed real number |
static MathParser\Extensions\Complex::log |
( |
|
$z | ) |
|
|
static |
complex logarithm function
Complex::log($z) computes and returns the principal branch of log($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::mul |
( |
|
$z, |
|
|
|
$w |
|
) |
| |
|
static |
multiply two complex numbers
Complex::mul($z, $w) computes and returns $z*$w
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::parse |
( |
|
$value | ) |
|
|
static |
convert data to a complex number, if possible
- Parameters
-
- Exceptions
-
SyntaxErrorException | if the string cannot be parsed |
- Return values
-
static MathParser\Extensions\Complex::parseReal |
( |
|
$value | ) |
|
|
staticprivate |
convert string to floating point number, if possible
decimal commas accepted
- Parameters
-
- Exceptions
-
SyntaxErrorException | if the string cannot be parsed |
- Return values
-
static MathParser\Extensions\Complex::pow |
( |
|
$z, |
|
|
|
$w |
|
) |
| |
|
static |
powers of two complex numbers
Complex::pow($z, $w) computes and returns the principal value of $z^$w
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::powi |
( |
|
$z, |
|
|
|
$n |
|
) |
| |
|
staticprivate |
integer power of a complex number
Complex::powi($z, $n) computes and returns $z^$n where $n is an integer
- Parameters
-
- Return values
-
MathParser\Extensions\Complex::r |
( |
| ) |
|
static MathParser\Extensions\Complex::sin |
( |
|
$z | ) |
|
|
static |
complex sine function
Complex::sin($z) computes and returns sin($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::sinh |
( |
|
$z | ) |
|
|
static |
complex hyperbolic sine function
Complex::sinh($z) computes and returns sinh($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::sqrt |
( |
|
$z | ) |
|
|
static |
complex square root function
Complex::sqrt($z) computes and returns the principal branch of sqrt($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::sub |
( |
|
$z, |
|
|
|
$w |
|
) |
| |
|
static |
subtract two complex numbers
Complex::sub($z, $w) computes and returns $z-$w
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::tan |
( |
|
$z | ) |
|
|
static |
complex tangent function
Complex::tan($z) computes and returns tan($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::tanh |
( |
|
$z | ) |
|
|
static |
complex hyperbolic tangent function
Complex::tanh($z) computes and returns tanh($z)
- Parameters
-
- Return values
-
static MathParser\Extensions\Complex::toFloat |
( |
|
$x | ) |
|
|
staticprivate |
convert data to a floating point number, if possible
- Parameters
-
- Exceptions
-
SyntaxErrorException | if the string cannot be parsed |
- Return values
-
The documentation for this class was generated from the following file:
- src/MathParser/Extensions/Complex.php