We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42ad53f commit 46cb953Copy full SHA for 46cb953
atan2.go
@@ -2,6 +2,25 @@ package math32
2
3
import "math"
4
5
-func Atan2(x, y float32) float32 {
6
- return float32(math.Atan2(float64(x), float64(y)))
+// Atan2 returns the arc tangent of y/x, using the signs of the two to determine the quadrant of the return value.
+// Special cases are (in order):
7
+// Atan2(y, NaN) = NaN
8
+// Atan2(NaN, x) = NaN
9
+// Atan2(+0, x>=0) = +0
10
+// Atan2(-0, x>=0) = -0
11
+// Atan2(+0, x<=-0) = +Pi
12
+// Atan2(-0, x<=-0) = -Pi
13
+// Atan2(y>0, 0) = +Pi/2
14
+// Atan2(y<0, 0) = -Pi/2
15
+// Atan2(+Inf, +Inf) = +Pi/4
16
+// Atan2(-Inf, +Inf) = -Pi/4
17
+// Atan2(+Inf, -Inf) = 3Pi/4
18
+// Atan2(-Inf, -Inf) = -3Pi/4
19
+// Atan2(y, +Inf) = 0
20
+// Atan2(y>0, -Inf) = +Pi
21
+// Atan2(y<0, -Inf) = -Pi
22
+// Atan2(+Inf, x) = +Pi/2
23
+// Atan2(-Inf, x) = -Pi/2
24
+func Atan2(y, x float32) float32 {
25
+ return float32(math.Atan2(float64(y), float64(x)))
26
}
0 commit comments