ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
atanh.php
Go to the documentation of this file.
1 <?php
2 
10 namespace Complex;
11 
19 if (!function_exists(__NAMESPACE__ . '\\atanh')) {
20  function atanh($complex): Complex
21  {
22  $complex = Complex::validateComplexArgument($complex);
23 
24  if ($complex->isReal()) {
25  $real = $complex->getReal();
26  if ($real >= -1.0 && $real <= 1.0) {
27  return new Complex(\atanh($real));
28  } else {
29  return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2));
30  }
31  }
32 
33  $iComplex = clone $complex;
34  $iComplex = $iComplex->invertImaginary()
35  ->reverse();
36  return atan($iComplex)
37  ->invertReal()
38  ->reverse();
39  }
40 }