Distance calculates the distance between to vectors with the Pythagoras theorem
(a, b Vector)
| 13 | |
| 14 | // Distance calculates the distance between to vectors with the Pythagoras theorem |
| 15 | func Distance(a, b Vector) float64 { |
| 16 | res := math.Pow(b.x-a.x, 2.0) + math.Pow(b.y-a.y, 2.0) + math.Pow(b.z-a.z, 2.0) |
| 17 | return math.Sqrt(res) |
| 18 | } |