moved geom to vector package
This commit is contained in:
parent
b495b16065
commit
38a7ea6805
16
geom.go
16
geom.go
@ -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)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user