LINEFIT Fit a straight line to a set of points.

   L = lineFit(X, Y)
   Computes parametric line minimizing square error of all points (X,Y).
   Result is a 4*1 array, containing coordinates of a point of the line,
   and the direction vector of the line, that is  L=[x0 y0 dx dy];

   L = lineFit(PTS) 
   Gives coordinats of points in a single array.

   L = lineFit(PT0, PTS);
   L = lineFit(PT0, X, Y);
   with PT0 = [x0 y0], imposes the line to contain point PT0.

   Requires:
   Optimiaztion toolbox

   See also:
   lines2d, polyfit, polyfit2, lsqlin


   -----
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 30/04/2004.

Package: matgeom