atan2
Returns the angle theta of the polar coordinates (r, theta) that correspond to the rectangular coordinates (x, y) by computing the arc tangent of the value y / x; the returned value is an angle in the range from -PI to PI radians.
Special cases:
- atan2(0.0, 0.0)is- 0.0
- atan2(0.0, x)is- 0.0for- x > 0and- PIfor- x < 0
- atan2(-0.0, x)is- -0.0for 'x 0- and-PI- forx < 0`
- atan2(y, +Inf)is- 0.0for- 0 < y < +Infand- -0.0for '-Inf < y < 0`
- atan2(y, -Inf)is- PIfor- 0 < y < +Infand- -PIfor- -Inf < y < 0
- atan2(y, 0.0)is- PI/2for- y > 0and- -PI/2for- y < 0
- atan2(+Inf, x)is- PI/2for finite- xy
- atan2(-Inf, x)is- -PI/2for finite- x
- atan2(NaN, x)and- atan2(y, NaN)is- NaN
Since Kotlin
1.2Returns the angle theta of the polar coordinates (r, theta) that correspond to the rectangular coordinates (x, y) by computing the arc tangent of the value y / x; the returned value is an angle in the range from -PI to PI radians.
Special cases:
- atan2(0.0, 0.0)is- 0.0
- atan2(0.0, x)is- 0.0for- x > 0and- PIfor- x < 0
- atan2(-0.0, x)is- -0.0for 'x 0- and-PI- forx < 0`
- atan2(y, +Inf)is- 0.0for- 0 < y < +Infand- -0.0for '-Inf < y < 0`
- atan2(y, -Inf)is- PIfor- 0 < y < +Infand- -PIfor- -Inf < y < 0
- atan2(y, 0.0)is- PI/2for- y > 0and- -PI/2for- y < 0
- atan2(+Inf, x)is- PI/2for finite- xy
- atan2(-Inf, x)is- -PI/2for finite- x
- atan2(NaN, x)and- atan2(y, NaN)is- NaN
Since Kotlin
1.2Returns the angle theta of the polar coordinates (r, theta) that correspond to the rectangular coordinates (x, y) by computing the arc tangent of the value y / x; the returned value is an angle in the range from -PI to PI radians.
Special cases:
- atan2(0.0, 0.0)is- 0.0
- atan2(0.0, x)is- 0.0for- x > 0and- PIfor- x < 0
- atan2(-0.0, x)is- -0.0for 'x 0- and-PI- forx < 0`
- atan2(y, +Inf)is- 0.0for- 0 < y < +Infand- -0.0for '-Inf < y < 0`
- atan2(y, -Inf)is- PIfor- 0 < y < +Infand- -PIfor- -Inf < y < 0
- atan2(y, 0.0)is- PI/2for- y > 0and- -PI/2for- y < 0
- atan2(+Inf, x)is- PI/2for finite- xy
- atan2(-Inf, x)is- -PI/2for finite- x
- atan2(NaN, x)and- atan2(y, NaN)is- NaN
Since Kotlin
1.2Returns the angle theta of the polar coordinates (r, theta) that correspond to the rectangular coordinates (x, y) by computing the arc tangent of the value y / x; the returned value is an angle in the range from -PI to PI radians.
Special cases:
- atan2(0.0, 0.0)is- 0.0
- atan2(0.0, x)is- 0.0for- x > 0and- PIfor- x < 0
- atan2(-0.0, x)is- -0.0for 'x 0- and-PI- forx < 0`
- atan2(y, +Inf)is- 0.0for- 0 < y < +Infand- -0.0for '-Inf < y < 0`
- atan2(y, -Inf)is- PIfor- 0 < y < +Infand- -PIfor- -Inf < y < 0
- atan2(y, 0.0)is- PI/2for- y > 0and- -PI/2for- y < 0
- atan2(+Inf, x)is- PI/2for finite- xy
- atan2(-Inf, x)is- -PI/2for finite- x
- atan2(NaN, x)and- atan2(y, NaN)is- NaN