ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
acos.php
Go to the documentation of this file.
1<?php
2
10namespace Complex;
11
19if (!function_exists(__NAMESPACE__ . '\\acos')) {
20 function acos($complex): Complex
21 {
22 $complex = Complex::validateComplexArgument($complex);
23
24 $square = clone $complex;
25 $square = multiply($square, $complex);
26 $invsqrt = new Complex(1.0);
27 $invsqrt = subtract($invsqrt, $square);
28 $invsqrt = sqrt($invsqrt);
29 $adjust = new Complex(
30 $complex->getReal() - $invsqrt->getImaginary(),
31 $complex->getImaginary() + $invsqrt->getReal()
32 );
33 $log = ln($adjust);
34
35 return new Complex(
36 $log->getImaginary(),
37 -1 * $log->getReal()
38 );
39 }
40}
An exception for terminatinating execution or to throw for unit testing.
$log
Definition: sabredav.php:21