Skip to content

Commit 2224cdf

Browse files
committed
Eliminating redefined constant
1 parent 09e2dd3 commit 2224cdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

s2/s2_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"math/rand"
2323
"os"
2424

25+
"github.com/golang/geo/earth"
2526
"github.com/golang/geo/r1"
2627
"github.com/golang/geo/r2"
2728
"github.com/golang/geo/s1"
@@ -74,8 +75,7 @@ func float64Near(x, y, ε float64) bool {
7475
return math.Abs(x-y) <= ε
7576
}
7677

77-
// The Earth's mean radius in kilometers (according to NASA).
78-
const earthRadiusKm = 6371.01
78+
var earthRadiusKm = earth.Radius.Kilometers()
7979

8080
// kmToAngle converts a distance on the Earth's surface to an angle.
8181
func kmToAngle(km float64) s1.Angle {

0 commit comments

Comments
 (0)