Difference between revisions of "Least-squares circle fitting"

From JSXGraph Wiki
Jump to navigationJump to search
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 17:43, 5 November 2010