atan2.md (1111B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 2 3 # Function atan2 4 5 Calculate the inverse tangent function with two arguments, y/x. 6 By providing two arguments, the right quadrant of the computed angle can be 7 determined. 8 9 For matrices, the function is evaluated element wise. 10 11 12 ## Syntax 13 14 ```js 15 math.atan2(y, x) 16 ``` 17 18 ### Parameters 19 20 Parameter | Type | Description 21 --------- | ---- | ----------- 22 `y` | number | Array | Matrix | Second dimension 23 `x` | number | Array | Matrix | First dimension 24 25 ### Returns 26 27 Type | Description 28 ---- | ----------- 29 number | Array | Matrix | Four-quadrant inverse tangent 30 31 32 ### Throws 33 34 Type | Description 35 ---- | ----------- 36 37 38 ## Examples 39 40 ```js 41 math.atan2(2, 2) / math.pi // returns number 0.25 42 43 const angle = math.unit(60, 'deg') // returns Unit 60 deg 44 const x = math.cos(angle) 45 const y = math.sin(angle) 46 47 math.atan(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i 48 ``` 49 50 51 ## See also 52 53 [tan](tan.md), 54 [atan](atan.md), 55 [sin](sin.md), 56 [cos](cos.md)