1 | import { factory } from '../../utils/factory.js';
|
2 | import { deepMap } from '../../utils/collection.js';
|
3 | import { cotNumber } from '../../plain/number/index.js';
|
4 | var name = 'cot';
|
5 | var dependencies = ['typed', 'BigNumber'];
|
6 | export var createCot = factory(name, dependencies, (_ref) => {
|
7 | var {
|
8 | typed,
|
9 | BigNumber: _BigNumber
|
10 | } = _ref;
|
11 |
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | return typed(name, {
|
34 | number: cotNumber,
|
35 | Complex: function Complex(x) {
|
36 | return x.cot();
|
37 | },
|
38 | BigNumber: function BigNumber(x) {
|
39 | return new _BigNumber(1).div(x.tan());
|
40 | },
|
41 | Unit: function Unit(x) {
|
42 | if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {
|
43 | throw new TypeError('Unit in function cot is no angle');
|
44 | }
|
45 |
|
46 | return this(x.value);
|
47 | },
|
48 | 'Array | Matrix': function ArrayMatrix(x) {
|
49 | return deepMap(x, this);
|
50 | }
|
51 | });
|
52 | }); |
\ | No newline at end of file |