mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 16:02:26 +08:00
加载lua脚本方法
This commit is contained in:
@@ -1,14 +1,7 @@
|
||||
package model
|
||||
|
||||
import "math"
|
||||
|
||||
type Vector struct {
|
||||
X float64
|
||||
Y float64
|
||||
Z float64
|
||||
}
|
||||
|
||||
// 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