1 | import { factory } from '../../utils/factory';
|
2 | import { deepMap } from '../../utils/collection';
|
3 | var name = 'atan';
|
4 | var dependencies = ['typed'];
|
5 | export var createAtan =
|
6 | /* #__PURE__ */
|
7 | factory(name, dependencies, function (_ref) {
|
8 | var typed = _ref.typed;
|
9 |
|
10 | /**
|
11 | * Calculate the inverse tangent of a value.
|
12 | *
|
13 | * For matrices, the function is evaluated element wise.
|
14 | *
|
15 | * Syntax:
|
16 | *
|
17 | * math.atan(x)
|
18 | *
|
19 | * Examples:
|
20 | *
|
21 | * math.atan(0.5) // returns number 0.4636476090008061
|
22 | * math.atan(math.tan(1.5)) // returns number 1.5
|
23 | *
|
24 | * math.atan(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
|
25 | *
|
26 | * See also:
|
27 | *
|
28 | * tan, asin, acos
|
29 | *
|
30 | * @param {number | BigNumber | Complex | Array | Matrix} x Function input
|
31 | * @return {number | BigNumber | Complex | Array | Matrix} The arc tangent of x
|
32 | */
|
33 | var atan = typed('atan', {
|
34 | number: function number(x) {
|
35 | return Math.atan(x);
|
36 | },
|
37 | Complex: function Complex(x) {
|
38 | return x.atan();
|
39 | },
|
40 | BigNumber: function BigNumber(x) {
|
41 | return x.atan();
|
42 | },
|
43 | 'Array | Matrix': function ArrayMatrix(x) {
|
44 | // deep map collection, skip zeros since atan(0) = 0
|
45 | return deepMap(x, atan, true);
|
46 | }
|
47 | });
|
48 | return atan;
|
49 | }); |
\ | No newline at end of file |