forked from paulmach/orb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefine_test.go
More file actions
36 lines (28 loc) · 745 Bytes
/
define_test.go
File metadata and controls
36 lines (28 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package project
import (
"math"
"testing"
"github.com/paulmach/orb/internal/mercator"
)
func TestDefineDeg2Rad(t *testing.T) {
if math.Abs(deg2rad(0.0)) > mercator.Epsilon {
t.Error("define, deg2rad error")
}
if math.Abs(deg2rad(180.0)-math.Pi) > mercator.Epsilon {
t.Error("define, deg2rad error")
}
if math.Abs(deg2rad(360.0)-2*math.Pi) > mercator.Epsilon {
t.Error("define, deg2rad error")
}
}
func TestDefineRad2Deg(t *testing.T) {
if math.Abs(rad2deg(0.0)-0.0) > mercator.Epsilon {
t.Error("define, rad2deg error")
}
if math.Abs(rad2deg(math.Pi)-180.0) > mercator.Epsilon {
t.Error("define, rad2deg error")
}
if math.Abs(rad2deg(2*math.Pi)-360.0) > mercator.Epsilon {
t.Error("define, rad2deg error")
}
}