溺水传送至安全位置初步
This commit is contained in:
1 parent
056ae5f8d8
commit
a288892f26
9 files changed
+102
-63
No files matched your search
@@ -1,7 +1,14 @@
|
||||
package model
|
||||
|
||||
import "math"
|
||||
|
||||
type Vector struct {
|
||||
X float64 `bson:"x"`
|
||||
Y float64 `bson:"y"`
|
||||
Z float64 `bson:"z"`
|
||||
}
|
||||
|
||||
// Distance 两坐标之间的距离
|
||||
func (v *Vector) Distance(vector *Vector) float64 {
|
||||
return math.Sqrt(math.Pow(v.X-vector.X, 2) + math.Pow(v.Y-vector.Y, 2) + math.Pow(v.Z-vector.Z, 2))
|
||||
}
|
||||
Reference in new issue
Block a user