draw2d/path/utils.go
2015-04-29 10:28:05 +02:00

13 lines
212 B
Go

package path
import (
"math"
)
func distance(x1, y1, x2, y2 float64) float64 {
return vectorDistance(x2-x1, y2-y1)
}
func vectorDistance(dx, dy float64) float64 {
return float64(math.Sqrt(dx*dx + dy*dy))
}