float32 -> float64

This commit is contained in:
sm
2014-04-26 15:37:07 -07:00
parent bfa28464d6
commit 461ee96e83
4 changed files with 35 additions and 34 deletions
+8 -7
View File
@@ -129,7 +129,7 @@ func TestAngle(t *testing.T) {
cases := []struct {
v1 Vector2d
v2 Vector2d
expected float32
expected float64
}{
{
v1: Vector2d{10, 0},
@@ -159,7 +159,7 @@ func TestAngle(t *testing.T) {
expected: math.Pi * Rad2deg,
},
}
var a float32
var a float64
for _, c := range cases {
a = Angle(c.v2, c.v1)
@@ -508,11 +508,12 @@ func TestPolyPolyNoOverlapMoveOnto(t *testing.T) {
func TestOrientedSquare(t *testing.T) {
p := OrientedSquare(Point2d{10, 10}, Vector2d{0.5, 0.5}, 5)
expected := []Vector2d{
{0, 7.071068},
{-7.071068, 0},
{0, -7.071068},
{7.071068, 0},
{X: 0, Y: 7.071067811865475},
{X: -7.071067811865475, Y: 0},
{X: 0, Y: -7.071067811865475},
{X: 7.071067811865475, Y: 0},
}
for i, v := range expected {
if p.Points[i] != v {
t.Errorf("unexpected points: %+v, expected: %+v", p.Points, expected)
@@ -522,7 +523,7 @@ func TestOrientedSquare(t *testing.T) {
func TestPopPop(t *testing.T) {
v1 := Vector2d{10, 10}
if v1.PopPop() != float32(math.Sqrt(10*10+10*10)) {
if v1.PopPop() != math.Sqrt(10*10+10*10) {
t.Errorf("Incorrect Magnitude!")
}
}