File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 7
7
"fmt"
8
8
"testing"
9
9
10
- "github.com/elgopher/pi"
11
10
"github.com/stretchr/testify/assert"
11
+
12
+ "github.com/elgopher/pi"
12
13
)
13
14
14
15
const delta = 0.000000000000001
@@ -92,16 +93,16 @@ func TestCos(t *testing.T) {
92
93
func TestAtan2 (t * testing.T ) {
93
94
type params struct { dx , dy float64 }
94
95
tests := map [params ]float64 {
95
- params {0 , 0 }: 0.75 , // TODO In Pico-8 this is 0.25
96
- params {0.001 , 0.001 }: 0.875 ,
97
- params {0 , 1 }: 0.75 ,
98
- params {1 , 0 }: 0 ,
99
- params {1 , 1 }: 0.875 ,
100
- params {- 1 , - 1 }: 0.375 ,
101
- params {- 1 , 1 }: 0.625 ,
102
- params {1 , - 1 }: 0.125 ,
103
- params {1 , 2 }: 0.8237918088252166 ,
104
- params {1 , - 0.3 }: 0.04638678953887121 ,
96
+ {0 , 0 }: 0.75 , // TODO In Pico-8 this is 0.25
97
+ {0.001 , 0.001 }: 0.875 ,
98
+ {0 , 1 }: 0.75 ,
99
+ {1 , 0 }: 0 ,
100
+ {1 , 1 }: 0.875 ,
101
+ {- 1 , - 1 }: 0.375 ,
102
+ {- 1 , 1 }: 0.625 ,
103
+ {1 , - 1 }: 0.125 ,
104
+ {1 , 2 }: 0.8237918088252166 ,
105
+ {1 , - 0.3 }: 0.04638678953887121 ,
105
106
}
106
107
for p , expected := range tests {
107
108
name := fmt .Sprintf ("%+v" , p )
You can’t perform that action at this time.
0 commit comments