Least-squares circle fitting: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 25: Line 25:
c = JXG.Math.matVecMult(MT, y);
c = JXG.Math.matVecMult(MT, y);
coeffs = JXG.Math.Numerics.Gauss(B, c);
coeffs = JXG.Math.Numerics.Gauss(B, c);
alert(coeffs.toString());
 
var xm = coeffs[0]*0.5;
var ym = coeffs[1]*0.5;
var r = Math.sqrt(coeffs[2]+xm*xm+ym*ym);
brd.create('circle',[ [xm,ym], r]);  





Revision as of 15:43, 5 November 2010