Least-squares line fitting: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 28: Line 28:
for (i=0;i<n;i++) {
for (i=0;i<n;i++) {
     M.push([p[i].X(), p[i].Y()]);
     M.push([p[i].X(), p[i].Y()]);
     y.push(1.0);
     y.push(-1.0);
}
}


Line 47: Line 47:
//var r = Math.sqrt(z[2]+xm*xm+ym*ym);
//var r = Math.sqrt(z[2]+xm*xm+ym*ym);


brd.create('line',[1,z[0], z[1]]);  
brd.create('line',[1, z[0], z[1]]);  


</jsxgraph>
</jsxgraph>

Revision as of 19:32, 5 November 2010