%  Fit a line to the locations where footprints are believed to
%  exist.  The locations of these points are determined by the
%  peaks.m function.
function [] = LineFit(N,bigimsize)
  %  Iterate through the different footprint types.
    for imagenum = 1:1:3
      xint = [];
      %  Find all of the footprints of the given type.
      [Frow, Fcol] = find(N(4,:)==imagenum);
      %  Find the average angle of orientation of the footprints
      %  relative to due North.
      angle = mean(N(3,Fcol));
      %  The color of the line is based on the animal.
      switch imagenum
       case{1}
	linecolor = [1,0,0];
       case{2}
	linecolor = [0,1,0];
       case{3}
	linecolor = [0,0,1];
      end
      %  Prevent problems with infinite slope by taking care of the
      %  special case when the print is pointed due North.
      if angle == 0
	%  The x intercept
	xint = mean(N(2,Fcol));
	%  Draw a vertical line
	line([xint, xint], [0, bigimsize], 'color', linecolor)
      else
	slope = tan(-angle*pi/180+pi/2);
	yint = mean(N(1,Fcol)-slope.*N(2,Fcol));
	line([0,bigimsize],[yint,slope*bigimsize+yint], 'color',linecolor)
      end
    end
	