Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class Cosecant |
||
9 | { |
||
10 | /** |
||
11 | * CSC. |
||
12 | * |
||
13 | * Returns the cosecant of an angle. |
||
14 | * |
||
15 | * @param float $angle Number |
||
16 | * |
||
17 | * @return float|string The cosecant of the angle |
||
18 | */ |
||
19 | 18 | public static function csc($angle) |
|
20 | { |
||
21 | try { |
||
22 | 18 | $angle = Helpers::validateNumericNullBool($angle); |
|
23 | 1 | } catch (Exception $e) { |
|
24 | 1 | return $e->getMessage(); |
|
25 | } |
||
26 | |||
27 | 17 | return Helpers::verySmallDenominator(1.0, sin($angle)); |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * CSCH. |
||
32 | * |
||
33 | * Returns the hyperbolic cosecant of an angle. |
||
34 | * |
||
35 | * @param float $angle Number |
||
36 | * |
||
37 | * @return float|string The hyperbolic cosecant of the angle |
||
38 | */ |
||
39 | 20 | public static function csch($angle) |
|
48 | } |
||
49 | } |
||
50 |