function [V,ev] = draw_smallvectors( M, d, T, X )
s=size(M,1);
n=floor(s/d);
[V,D]=eig(M);
min=100;
p=0;
for i=1:s
    if (D(i,i)<min) 
        min=D(i,i);
        p=i;
    end
end
vf=reshape(V(:,p),d,n);
vu = zeros(3, size(X,1));
for i = 1:size(X, 1)
     vu(:, i) = T(:,:,i) * vf(:, i);
     %vu(:, i) = vu(:, i)./norm(vu(:, i));
end
figure;
quiver3(X(:,1),X(:,2),X(:,3), vu(1,:)', vu(2,:)', vu(3,:)',2);
view(-12,10);
%view(0,90);
axis off;
figure;
ev=zeros(size(D,1),1);
for i=1:size(D,1)
    ev(i)=D(i,i);
end
ev=sort(ev);
x=1:size(ev);
plot(x,ev);



end

