function dShowAproximation( x1, y1, z1, d, tt )
% dShowAproximation - plots second order approximation of the error function
% 	dShowAproximation( x1, y1, z1, d, tt )


sx = std(x1);
x1old = x1;
dx = (-2*sx:10:2*sx)';

for i = 1: length(x1);
	xt = x1(i) + dx;
	err  = zeros(size(xt));
	f    = zeros(size(xt));
	[e0, gx,gy,gz, Gx,Gy,Gz] = dErrorF( x1, y1, z1, d, tt);
	for j = 1:length(xt);
		x1(i) = xt(j);	
		err(j)  = dErrorF( x1, y1, z1, d, tt);
		h = x1 - x1old;
		f(j) = e0 + h'*gx + 1/2*h'*Gx*h;
	end;
	x1 = x1old;
	plot(xt, [err f]); a = axis; line([x1old(i) x1old(i)],[a(3) a(4) ]); title(num2str(i));

	s = input('Continue (Y/N)?','s');
	if ( lower(s(1:length(s))) == 'n'), break; end;
end;

return