function OK = quat_test

%quat_test  test for quat
%
%     3    6        
%    +----+        
%    |    |        
%    |2   |5       2    4    6
%    +----+       +----+----+      
%    |    |       |    |    |     
%    |1   |4      |1   |3   |5    
%    X----+       X----+----+
%
%    (x,y)        (x',y')
%
%See also: quat

x     = [0 1;0 1;0 1];
y     = [0 0;1 1;2 2];
x2    = [0 0 0;1 1 1];
y2    = [0 1 2;0 1 2];

OK(1) = isequal(quat(x ,y ),[1 2 5 4;2 3 6 5]);
OK(2) = isequal(quat(x',y'),[1 2 4 3;3 4 6 5]);
OK(3) = isequal(quat(x2,y2),[1 2 4 3;3 4 6 5]);

x (1) = nan;
y (1) = nan;
x2(1) = nan;
y2(1) = nan;

OK(4) = isequal(quat(x ,y ),[2 3 6 5]);
OK(5) = isequal(quat(x',y'),[3 4 6 5]);
OK(6) = isequal(quat(x2,y2),[3 4 6 5]);

OK(7) = isequal(quat(x ,y ,'sub2ind',0),[2 3 6 5]-1);
OK(8) = isequal(quat(x',y','sub2ind',0),[3 4 6 5]-1);
OK(9) = isequal(quat(x2,y2,'sub2ind',0),[3 4 6 5]-1);


