Fix tests after rover change

This commit is contained in:
Marc Di Luzio 2020-06-25 23:51:31 +01:00
parent f0f5a6b2e0
commit 93b99b7989
4 changed files with 23 additions and 7 deletions

View file

@ -1,6 +1,10 @@
package vector
import "math"
import (
"math"
"github.com/mdiluz/rove/pkg/maths"
)
// Vector desribes a 3D vector
type Vector struct {
@ -45,3 +49,8 @@ func (v Vector) Multiplied(val int) Vector {
func (v Vector) Divided(val int) Vector {
return Vector{v.X / val, v.Y / val}
}
// Abs returns an absolute version of the vector
func (v Vector) Abs() Vector {
return Vector{maths.Abs(v.X), maths.Abs(v.Y)}
}