Least-squares line fitting: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 24: Line 24:
// where x_i, y_i is the position of point p_i
// where x_i, y_i is the position of point p_i
// y is equal to the zero vector.
// y is equal to the zero vector.
var M = [], y= [1,1,1], MT, B, c, z, n;
var M = [], y= [2,2,2], MT, B, c, z, n;
n = p.length;
n = p.length;
for (i=0;i<n;i++) {
for (i=0;i<n;i++) {

Revision as of 19:23, 5 November 2010