forked from josdejong/mathjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatan.js
More file actions
43 lines (39 loc) · 1003 Bytes
/
atan.js
File metadata and controls
43 lines (39 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { factory } from '../../utils/factory.js'
const name = 'atan'
const dependencies = ['typed']
export const createAtan = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {
/**
* Calculate the inverse tangent of a value.
*
* To avoid confusion with matrix arctangent, this function does not apply
* to matrices.
*
* Syntax:
*
* math.atan(x)
*
* Examples:
*
* math.atan(0.5) // returns number 0.4636476090008061
* math.atan(2) // returns number 1.1071487177940904
* math.atan(math.tan(1.5)) // returns number 1.5
*
* See also:
*
* tan, asin, acos
*
* @param {number | BigNumber | Complex} x Function input
* @return {number | BigNumber | Complex} The arc tangent of x
*/
return typed('atan', {
number: function (x) {
return Math.atan(x)
},
Complex: function (x) {
return x.atan()
},
BigNumber: function (x) {
return x.atan()
}
})
})