function scaling3D_test(a,b,c)

% This function scales a cube by
% 
% Input: 
%      a along e1
%      b along e2
%      c along e3 
 
cubeVerts = 1*([0 0 0; 1 0 0; 1 1 0; 0 1 0; 0 0 1; 1 0 1; 1 1 1; 0 1 1] - 0.5);
faces = [1 2 6 5; 2 3 7 6; 3 4 8 7; 4 1 5 8; 1 2 3 4; 5 6 7 8];
cubeVerts=cubeVerts';

S= @(a,b,c) [ a  0  0;
              0  b  0;
              0  0  c];

% Reference cube
figure(1)
clf
patch('Vertices',cubeVerts','Faces',faces, 'FaceVertexCData',hsv(6),'FaceColor', 'flat');
view(120, 30);
axis equal
axis([-2 2 -2 2 -2 2]);
grid on;

% Scaled cube
figure(2)
clf
patch('Vertices',(S(a,b,c)*cubeVerts)','Faces',faces, 'FaceVertexCData',hsv(6),'FaceColor', 'flat');
view(120, 30);
axis equal
axis([-2 2 -2 2 -2 2]);
grid on;


