14 lines
212 B
Go
14 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))
|
||
|
}
|