摘要:
type Vector3 struct { X float64 `json:"x"` Y float64 `json:"y"` Z float64 `json:"z"` } func GetAngle(v1 Vector3,v2 Vector3) (angel float64) { //求两向量夹角 a := v1.X * v2.X +... 阅读全文
摘要:
func LeastSquares(x[]float64,y[]float64)(a float64,b float64){ // x是横坐标数据,y是纵坐标数据 // a是斜率,b是截距 xi := float64(0) x2 := float64(0) yi := float64(0) xy := float64(0) if len(... 阅读全文