math.atan2() function
The math.atan2()
function returns the arc tangent of y
/x
, using the signs
of the two to determine the quadrant of the return value.
Output data type: Float
import "math"
math.atan2(y: 1.22, x: 3.14)
// Returns 0.3705838802763881
Parameters
y
The y coordinate used in the operation.
x
The x coordinate used in the operation.
Special cases
math.atan2(y:y, x:NaN) // Returns NaN
math.atan2(y: NaN, x:x) // Returns NaN
math.atan2(y: +0, x: >=0) // Returns +0
math.atan2(y: -0, x: >=0) // Returns -0
math.atan2(y: +0, x: <=-0) // Returns +Pi
math.atan2(y: -0, x: <=-0) // Returns -Pi
math.atan2(y: >0, x: 0) // Returns +Pi/2
math.atan2(y: <0, x: 0) // Returns -Pi/2
math.atan2(y: +Inf, x: +Inf) // Returns +Pi/4
math.atan2(y: -Inf, x: +Inf) // Returns -Pi/4
math.atan2(y: +Inf, x: -Inf) // Returns 3Pi/4
math.atan2(y: -Inf, x: -Inf) // Returns -3Pi/4
math.atan2(y:y, x: +Inf) // Returns 0
math.atan2(y: >0, x: -Inf) // Returns +Pi
math.atan2(y: <0, x: -Inf) // Returns -Pi
math.atan2(y: +Inf, x:x) // Returns +Pi/2
math.atan2(y: -Inf, x:x) // Returns -Pi/2
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.