% dErrFamily - calculates and plots family of error curves for each variable
%

t = 100;
d = dplane(dist,t); tt = dPlane(teta,t);
x1 = x(:,t); y1 = y(:,t); z1 = z(:,t);


% Plotting error for X
figure(1); clf; hold on;
q = x1;
sx = std(q);

for i = 1:length(q);

qi = q(i);
qt = q(i) + (-2*sx:20:2*sx);
err  = zeros(size(qt));
for j = 1:length(qt);
	q(i) = qt(j);
	err(j) = dErrorF( q, y1, z1, d, tt);
end;
q(i) = qi;
plot(qt, err); a = axis; line([qi qi],[a(3) a(4) ]); title(sprintf('%d',i));
drawnow;
end;
hold off;

% Plotting error for Y
figure(1); clf; hold on;
q = y1;
sx = std(q);

for i = 1:length(q);

qi = q(i);
qt = q(i) + (-2*sx:20:2*sx);
err  = zeros(size(qt));
for j = 1:length(qt);
	q(i) = qt(j);
	err(j) = dErrorF( x1, q, z1, d, tt);
end;
q(i) = qi;
plot(qt, err); a = axis; line([qi qi],[a(3) a(4) ]); title(sprintf('%d',i));
drawnow;
end;
hold off;

% Plotting error for Z
figure(1); clf; hold on;
q = z1;
sx = std(q);

for i = 1:length(q);

qi = q(i);
qt = q(i) + (-2*sx:20:2*sx);
err  = zeros(size(qt));
for j = 1:length(qt);
	q(i) = qt(j);
	err(j) = dErrorF( x1, y1, q, d, tt);
end;
q(i) = qi;
plot(qt, err); a = axis; line([qi qi],[a(3) a(4) ]); title(sprintf('%d',i));
drawnow;
end;
hold off;