Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 400 and 402] [Versions 401 and 402]

(no description)

File Size: 823 lines (31 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Functions:: (37 methods):
  abs()
  acos()
  acosh()
  acot()
  acoth()
  acsc()
  acsch()
  argument()
  asec()
  asech()
  asin()
  asinh()
  atan()
  atanh()
  conjugate()
  cos()
  cosh()
  cot()
  coth()
  csc()
  csch()
  exp()
  inverse()
  ln()
  log2()
  log10()
  negative()
  pow()
  rho()
  sec()
  sech()
  sin()
  sinh()
  sqrt()
  tan()
  tanh()
  theta()


Class: Functions  - X-Ref

abs($complex)   X-Ref
Returns the absolute value (modulus) of a complex number.
Also known as the rho of the complex number, i.e. the distance/radius
from the centrepoint to the representation of the number in polar coordinates.

This function is a synonym for rho()

param: Complex|mixed    $complex    Complex number or a numeric value.
return: float            The absolute (or rho) value of the complex argument.

acos($complex)   X-Ref
Returns the inverse cosine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse cosine of the complex argument.

acosh($complex)   X-Ref
Returns the inverse hyperbolic cosine of a complex number.

Formula from Wolfram Alpha:
cosh^(-1)z = ln(z + sqrt(z + 1) sqrt(z - 1)).

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse hyperbolic cosine of the complex argument.

acot($complex)   X-Ref
Returns the inverse cotangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse cotangent of the complex argument.

acoth($complex)   X-Ref
Returns the inverse hyperbolic cotangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse hyperbolic cotangent of the complex argument.

acsc($complex)   X-Ref
Returns the inverse cosecant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse cosecant of the complex argument.

acsch($complex)   X-Ref
Returns the inverse hyperbolic cosecant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse hyperbolic cosecant of the complex argument.

argument($complex)   X-Ref
Returns the argument of a complex number.
Also known as the theta of the complex number, i.e. the angle in radians
from the real axis to the representation of the number in polar coordinates.

This function is a synonym for theta()

param: Complex|mixed    $complex    Complex number or a numeric value.
return: float            The argument (or theta) value of the complex argument.

asec($complex)   X-Ref
Returns the inverse secant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse secant of the complex argument.

asech($complex)   X-Ref
Returns the inverse hyperbolic secant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse hyperbolic secant of the complex argument.

asin($complex)   X-Ref
Returns the inverse sine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse sine of the complex argument.

asinh($complex)   X-Ref
Returns the inverse hyperbolic sine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse hyperbolic sine of the complex argument.

atan($complex)   X-Ref
Returns the inverse tangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse tangent of the complex argument.

atanh($complex)   X-Ref
Returns the inverse hyperbolic tangent of a complex number.

Formula from Wolfram Alpha:
tanh^(-1)z = 1/2 [ln(1 + z) - ln(1 - z)].

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse hyperbolic tangent of the complex argument.

conjugate($complex)   X-Ref
Returns the complex conjugate of a complex number

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The conjugate of the complex argument.

cos($complex)   X-Ref
Returns the cosine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The cosine of the complex argument.

cosh($complex)   X-Ref
Returns the hyperbolic cosine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The hyperbolic cosine of the complex argument.

cot($complex)   X-Ref
Returns the cotangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The cotangent of the complex argument.

coth($complex)   X-Ref
Returns the hyperbolic cotangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The hyperbolic cotangent of the complex argument.

csc($complex)   X-Ref
Returns the cosecant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The cosecant of the complex argument.

csch($complex)   X-Ref
Returns the hyperbolic cosecant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The hyperbolic cosecant of the complex argument.

exp($complex)   X-Ref
Returns the exponential of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The exponential of the complex argument.

inverse($complex)   X-Ref
Returns the inverse of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The inverse of the complex argument.

ln($complex)   X-Ref
Returns the natural logarithm of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The natural logarithm of the complex argument.

log2($complex)   X-Ref
Returns the base-2 logarithm of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The base-2 logarithm of the complex argument.

log10($complex)   X-Ref
Returns the common logarithm (base 10) of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The common logarithm (base 10) of the complex argument.

negative($complex)   X-Ref
Returns the negative of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The negative value of the complex argument.

pow($complex, $power)   X-Ref
Returns a complex number raised to a power.

param: Complex|mixed    $complex    Complex number or a numeric value.
param: float|integer    $power      The power to raise this value to
return: Complex          The complex argument raised to the real power.

rho($complex)   X-Ref
Returns the rho of a complex number.
This is the distance/radius from the centrepoint to the representation of the number in polar coordinates.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: float            The rho value of the complex argument.

sec($complex)   X-Ref
Returns the secant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The secant of the complex argument.

sech($complex)   X-Ref
Returns the hyperbolic secant of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The hyperbolic secant of the complex argument.

sin($complex)   X-Ref
Returns the sine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The sine of the complex argument.

sinh($complex)   X-Ref
Returns the hyperbolic sine of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The hyperbolic sine of the complex argument.

sqrt($complex)   X-Ref
Returns the square root of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The Square root of the complex argument.

tan($complex)   X-Ref
Returns the tangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The tangent of the complex argument.

tanh($complex)   X-Ref
Returns the hyperbolic tangent of a complex number.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: Complex          The hyperbolic tangent of the complex argument.

theta($complex)   X-Ref
Returns the theta of a complex number.
This is the angle in radians from the real axis to the representation of the number in polar coordinates.

param: Complex|mixed    $complex    Complex number or a numeric value.
return: float            The theta value of the complex argument.