FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mathjs/src/function/trigonometry/acot.js at develop · rpeg/mathjs · GitHub
rpeg
/
mathjs
Public
forked from
josdejong/mathjs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
mathjs
/
src
/
function
/
trigonometry
/
acot.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (43 loc) · 1.21 KB
Breadcrumbs
mathjs
/
src
/
function
/
trigonometry
/
acot.js
Copy path
File metadata and controls
49 lines (43 loc) · 1.21 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
44
45
46
47
48
49
import
{
factory
}
from
'../../utils/factory'
import
{
deepMap
}
from
'../../utils/collection'
import
{
acotNumber
}
from
'../../plain/number'
const
name
=
'acot'
const
dependencies
=
[
'typed'
,
'BigNumber'
]
export
const
createAcot
=
/* #__PURE__ */
factory
(
name
,
dependencies
,
(
{
typed
,
BigNumber
}
)
=>
{
/**
* Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.
*
* For matrices, the function is evaluated element wise.
*
* Syntax:
*
* math.acot(x)
*
* Examples:
*
* math.acot(0.5) // returns number 0.4636476090008061
* math.acot(math.cot(1.5)) // returns number 1.5
*
* math.acot(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
*
* See also:
*
* cot, atan
*
*
@param
{
number | Complex | Array | Matrix
} x Function input
*
@return
{
number | Complex | Array | Matrix
} The arc cotangent of x
*/
const
acot
=
typed
(
name
,
{
number
:
acotNumber
,
Complex
:
function
(
x
)
{
return
x
.
acot
(
)
}
,
BigNumber
:
function
(
x
)
{
return
new
BigNumber
(
1
)
.
div
(
x
)
.
atan
(
)
}
,
'Array | Matrix'
:
function
(
x
)
{
return
deepMap
(
x
,
acot
)
}
}
)
return
acot
}
)
Back
|
FazBrowse Home
|
New Git URL