瀏覽代碼

拟合数据

lvjincheng 4 年之前
父節點
當前提交
4747cefa5e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Assets/BowArrow/Scripts/Bluetooth/ShootCheck.cs

+ 8 - 0
Assets/BowArrow/Scripts/Bluetooth/ShootCheck.cs

@@ -181,6 +181,14 @@ public class ShootCheck : MonoBehaviour
             {
                 maxAcc = acc;
             }
+            if (acc > 15.9f) {
+                double p1 = -1.188748333;
+                double p2 = 0.033890372;
+                double p3 = 3.408473747;
+                float x = (keyAccList.Count + 1) * 2; //单位毫秒
+                double y = 1.0 / (p1+p2*Mathf.Pow(x, 0.5f)*Mathf.Log(x)+p3/Mathf.Pow(x, 0.5f));
+                acc = (float) y;
+            }
             keyAccList.Enqueue(acc);
             keyTimeList.Enqueue(t);
             return false;