% vecDemo - Show a demo of the vecXXX functions
%   
% 
%

%----------------------------------------------------------------------
%   Bugs:
%
%   Date created: 
%          990910
%   Author:
%          Marten Levenstam
%
%   Change history:
%
%                              +---------------------------------------+ 
%                              |     Matematik Kf/Kb 1999-2000         | 
%                              |     Copyright (c) 1999                | 
%                              |                                       | 
%                              |     Marten Levenstam                  | 
%                              |     Klas Samuelsson                   | 
%                              |     Dep. of Mathematics               | 
%                              |     Chalmers University of Technology | 
%                              |     S-412 96 Gothenburg               | 
%                              |     SWEDEN                            |     
%                              |     martenl@math.chalmers.se          |     
%                              |                                       |     
%------------------------------+---------------------------------------+
hold off;


disp 'A vector in R2';
a = [1, 2]

input('Strike any key to proceed');

disp '----'
disp( 'Can be plotted: vecPlot(a)')
vecPlot(a);
hold on;
axis equal;
input('Strike any key to proceed');

disp '----'
disp 'the norm of a: vecNorm(a)'
vecNorm(a)

input('Strike any key to proceed');

disp '----'
disp 'Another vector in R2'
b = [.5, 1.5]
vecPlot(b,'r');

input('Strike any key to proceed');

disp '----'
disp 'scalar product between a and b: vecDot(a, b)'
vecDot(a, b)

input('Strike any key to proceed');

disp '----'
disp 'the projection of b onto a: vecProj(a, b)'
vecProj(a, b)
vecPlot(vecProj(a, b), 'g');
