Commit 1b3d11eb authored by 潘栩锋's avatar 潘栩锋 🚴

修复 MyMath 线性拟合的bug

parent caed97dd
......@@ -512,8 +512,8 @@ namespace Misc
}
if (cnt > 1)
{
a = (n * sum_xy - sum_x * sum_y) / (n * sum_x2 - sum_x * sum_x);
b = sum_y / n - a * sum_x / n;
a = (cnt * sum_xy - sum_x * sum_y) / (cnt * sum_x2 - sum_x * sum_x);
b = sum_y / cnt - a * sum_x / cnt;
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment