function Y=vecshift(O,X)
% vecshift - refer an array of vectors to a new origin.
%
% This SUBTRACTS the first argument (a vector) from each
% of the vectors (row or column) in the second argument.
% Works in two modes: row vector or column vector mode.
%
% vecshift :: 
%    [[N,1]] ~'new origin', 
%    [[N,M]] ~'array of vectors, array domain is M'
% -> [[N,M]] ~'vectors relative to new origin'.
%

% note: this now works for any pair of arrays where size O
% is an integer fraction of size X in any dimension
Y=X-repmat(O,1,size(X,2));

