moved geom to vector package

This commit is contained in:
Stephen McQuay 2013-09-03 23:32:36 -07:00
parent b495b16065
commit 38a7ea6805

16
geom.go
View File

@ -1,16 +0,0 @@
package main
import (
v "bitbucket.org/hackerbots/vector"
)
func distance(p1, p2 v.Point2d) float64 {
return p1.Sub(p2).Mag()
}
func move(d1, d2 v.Point2d, velocity float64, timeDelta float64) v.Point2d {
v := d2.Sub(d1)
v_norm := v.Normalize()
v_scaled := v_norm.Scale(velocity * timeDelta)
return d1.Add(v_scaled)
}