summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-11-17 08:39:56 -0800
committerRuss Cox <rsc@golang.org>2009-11-17 08:39:56 -0800
commit8de830a574a1c11eca8c704b8ebeb1d86fdb7c6c (patch)
tree9c36be41903a671c9a0de798ce626b5b8e695286
parent2c1444b4db9440d14c0f86cc2e84fd9531148514 (diff)
downloadgolang-8de830a574a1c11eca8c704b8ebeb1d86fdb7c6c.tar.gz
math: fix argument names in Atan2
(error introduced converting from arg1, arg2) Fixes issue 220. R=r http://codereview.appspot.com/156041
-rw-r--r--src/pkg/math/atan2.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/pkg/math/atan2.go b/src/pkg/math/atan2.go
index 7165c539e..26d3a1d68 100644
--- a/src/pkg/math/atan2.go
+++ b/src/pkg/math/atan2.go
@@ -4,20 +4,19 @@
package math
-
-// Atan returns the arc tangent of y/x, using
+// Atan2 returns the arc tangent of y/x, using
// the signs of the two to determine the quadrant
// of the return value.
-func Atan2(x, y float64) float64 {
+func Atan2(y, x float64) float64 {
// Determine the quadrant and call atan.
- if x+y == x {
- if x >= 0 {
+ if y+x == y {
+ if y >= 0 {
return Pi / 2
}
return -Pi / 2;
}
- q := Atan(x / y);
- if y < 0 {
+ q := Atan(y / x);
+ if x < 0 {
if q <= 0 {
return q + Pi
}