ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Cotangent.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class Cotangent
9 {
19  public static function cot($angle)
20  {
21  try {
23  } catch (Exception $e) {
24  return $e->getMessage();
25  }
26 
27  return Helpers::verySmallDenominator(cos($angle), sin($angle));
28  }
29 
39  public static function coth($angle)
40  {
41  try {
43  } catch (Exception $e) {
44  return $e->getMessage();
45  }
46 
47  return Helpers::verySmallDenominator(1.0, tanh($angle));
48  }
49 
59  public static function acot($number)
60  {
61  try {
62  $number = Helpers::validateNumericNullBool($number);
63  } catch (Exception $e) {
64  return $e->getMessage();
65  }
66 
67  return (M_PI / 2) - atan($number);
68  }
69 
79  public static function acoth($number)
80  {
81  try {
82  $number = Helpers::validateNumericNullBool($number);
83  } catch (Exception $e) {
84  return $e->getMessage();
85  }
86 
87  $result = ($number === 1) ? NAN : (log(($number + 1) / ($number - 1)) / 2);
88 
90  }
91 }
static validateNumericNullBool($number)
Many functions accept null/false/true argument treated as 0/0/1.
Definition: Helpers.php:27
$result
static numberOrNan($result)
Return NAN or value depending on argument.
Definition: Helpers.php:125
static verySmallDenominator(float $numerator, float $denominator)
Many functions accept null/false/true argument treated as 0/0/1.
Definition: Helpers.php:15
$angle