- 直线方程是y=a*x+b
- 推导如下图
- 右边例子是用(1,8)和(5,20)拟合直线

- C++代码如下
void GetLine(vector<MyPoint> v, float &a, float &b) {
float xy=0,x
C++实现直线拟合:从公式到代码详解

void GetLine(vector<MyPoint> v, float &a, float &b) {
float xy=0,x

被折叠的 条评论
为什么被折叠?