## Complex Functions

The complex functions are those functions that:

- take one or more arguments that are complex expressions or double expressions and
- return a complex value

Some terms that are used in this document:

- i the square root of -1

The set of available double functions is:

- one argument functions:

  Function Name | Description | Notes
  --- | --- | ---
  acsc | inverse cosecant | acsc(z) = asin(1.0 / z)
  acsch | inverse hyperbolic cosecant | acsch(z) = asinh(1.0 / z)
  acos | inverse cosine | acos(z) = -i * log(z + i * sqrt(1.0 - z * z))
  acosh | inverse hyperbolic cosine | acosh(z) = log(z + sqrt(z * z - 1.0))
  acot | inverse cotangent | acot(z) = atan(1.0 / z)
  acoth | inverse hyperbolic cotangent | acoth(z) = atanh(1.0 / z)
  asec | inverse secant | asec(z) = acos(1.0 / z)
  asech | inverse hyperbolic cosecant | asech(z) = acosh(1.0 / z)
  asin | inverse sin | asin(z) = -i * log(i * z + sqrt(1.0 - z * z))
  asinh | inverse hyperbolic sine | asinh(z) = log(z + sqrt(z * z + 1.0))
  atan | inverse tangent | result = tan(z), z = atan(result)
  atanh | inverse hyperbolic tangent | atanh(value) = log((value + 1.0) / (value - 1.0)) / 2.0
  conj | complex conjugate | if z = [real, imaginary] then conj(z) = [real, -imaginary]
  cos | cosine | cos(z) = (exp(i * z) + exp(-i * z)) / 2
  cosh | hyperbolic cosine | cosh(z) = (exp(z) + exp(-z)) / 2.0
  cot | cotangent | cot(z) = cos(z) / sin(z)
  coth | hyperbolic cotangent | coth(z) = cosh(z) / sinh(z)
  csc | cosecant | csc(z) = 1.0 / sin(z)
  csch | hyperbolic cosecant | csch(z) = 1.0 / sinh(z)
  exp | exponential | if z = [real, imaginary] then exp(z) = exp(real) * (cos(imaginary) + i * sin(imaginary))
  log | natural log | for z = [real, imaginary], we can also express z in terms of a distance 'r' and an angle 'theta'. log(z) = log(r) + i * theta. Log(z) is a multivalued function
  sec | secant | sec(z) = 1.0 / cos(z)
  sech | hyperbolic secant | sech(z) = 1.0 / cosh(z)
  sin | sine | sin(z) = (exp(i * z) - exp(-i * z)) / 2.0
  sinh | hyperbolic sine | sinh(z) = (exp(z) - exp(-z)) / 2.0
  sqrt | square root | The square root of z is the number that when multipled by itself is equal to z. For example: sqrt([0, 8]) == [2, 2]
  tan | tangent | tan(z) = sin(z) / cos(z)
  tanh | hyperbolic tangent | tanh(z) = sinh(z) / cosh(z)

- two argument functions:

  Function Name | Description | Notes
  --- | --- | ---
  pow | the power function | This function raises the first argument to the power of the second argument Here are some examples pow([2, 2], [2, 0]) = [0, 8] pow([1, 2], [3, 4]) = [0.12901, 0.0339241] This function can be used with a mixture of complex and real types as in: pow([2, 2], 2) pow(2, [123, 456]) NOTE: You can also write pow(z1, z2) as "z1 ^ z2"

- three argument functions:

  Function Name | Description | Notes
  --- | --- | ---
  rotate | rotates a point a certain number of degrees around another point | As an example: z = [2, 0]; z = rotate(z, [0, 0], 90); This example says "rotate the point 'z' 90 degrees around the point [0, 0] (the origin)". In this case, the result will be [0, 2]