Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Class for the management of Complex numbers

Copyright: Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex)
License: https://opensource.org/licenses/MIT MIT
File Size: 387 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Complex:: (14 methods):
  parseComplex()
  __construct()
  getReal()
  getImaginary()
  getSuffix()
  isReal()
  isComplex()
  format()
  __toString()
  validateComplexArgument()
  reverse()
  invertImaginary()
  invertReal()
  __call()


Class: Complex  - X-Ref

Complex Number object.

parseComplex($complexNumber)   X-Ref
Validates whether the argument is a valid complex number, converting scalar or array values if possible

param: mixed    $complexNumber   The value to parse
return: array

__construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i')   X-Ref
No description

getReal()   X-Ref
Gets the real part of this complex number

return: Float

getImaginary()   X-Ref
Gets the imaginary part of this complex number

return: Float

getSuffix()   X-Ref
Gets the suffix of this complex number

return: String

isReal()   X-Ref
Returns true if this is a real value, false if a complex value

return: Bool

isComplex()   X-Ref
Returns true if this is a complex value, false if a real value

return: Bool

format()   X-Ref
No description

__toString()   X-Ref
No description

validateComplexArgument($complex)   X-Ref
Validates whether the argument is a valid complex number, converting scalar or array values if possible

param: mixed    $complex   The value to validate
return: Complex

reverse()   X-Ref
Returns the reverse of this complex number

return: Complex

invertImaginary()   X-Ref
No description

invertReal()   X-Ref
No description

__call($functionName, $arguments)   X-Ref
Returns the result of the function call or operation

return: Complex|float