ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sin.php
Go to the documentation of this file.
1 <?php
2 
10 namespace Complex;
11 
19 if (!function_exists(__NAMESPACE__ . '\\sin')) {
20  function sin($complex): Complex
21  {
22  $complex = Complex::validateComplexArgument($complex);
23 
24  if ($complex->isReal()) {
25  return new Complex(\sin($complex->getReal()));
26  }
27 
28  return new Complex(
29  \sin($complex->getReal()) * \cosh($complex->getImaginary()),
30  \cos($complex->getReal()) * \sinh($complex->getImaginary()),
31  $complex->getSuffix()
32  );
33  }
34 }