V=[1 1 1; 1 0 -1; -1 1 0]';
B=V, B(:,1)=[0;0;0];        P skall skicka projektionsvektorn (1,2,1) på (0,0,0).
P=B*inv(V);

[X,Y] = meshgrid([-3:.25:3]);
Z = -X-Y;
contour3(X,Y,Z,30)
surface(X,Y,Z,'EdgeColor',[.8 .8 .8],'FaceColor','none')
view(20,20)

x=[-1,1,1,-1,-1,  -1,1,1,-1,-1, 1,1,1,1,-1,-1];
y=[-1,-1,1,1,-1,  -1,-1,1,1,-1, -1,-1,1,1,1,1];
z=[-1,-1,-1,-1,-1, 1,1,1,1,1,   1,-1,-1,1,1,-1];
t=ones(3,length(x));
U=[x;y;z]+3*t

line(U(1,:),U(2,:),U(3,:));
U=P*U;
line(U(1,:),U(2,:),U(3,:),'LineWidth',2);
axis equal