加载lua脚本方法

This commit is contained in:
flswld
2023-03-01 10:50:59 +08:00
parent 0395dc0bc2
commit a7b3f41839
8 changed files with 239 additions and 73 deletions

View File

@@ -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))
}