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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN
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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexyatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN
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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexyatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN
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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexyatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN
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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexyatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN
Since Kotlin
1.3Returns 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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexyatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN
Since Kotlin
1.8Returns 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)is0.0atan2(0.0, x)is0.0forx > 0andPIforx < 0atan2(-0.0, x)is-0.0forx > 0and-PIforx < 0atan2(y, +Inf)is0.0for0 < y < +Infand-0.0for-Inf < y < 0atan2(y, -Inf)isPIfor0 < y < +Infand-PIfor-Inf < y < 0atan2(y, 0.0)isPI/2fory > 0and-PI/2fory < 0atan2(+Inf, x)isPI/2for finitexyatan2(-Inf, x)is-PI/2for finitexatan2(NaN, x)andatan2(y, NaN)isNaN