直线方程是y=a*x+b 推导如下图 右边例子是用(1,8)和(5,20)拟合直线 C++代码如下 void GetLine(vector<MyPoint> v, float &a, float &b) { float xy=0,x