function h = bigarrow(x,y,w,h,c,a,b)
% BIGARROW Plots a big arrow
% H = BIGARROW(X,Y,W,H,[C,A,B])
%
% X,Y = Center of arrow
% W,H = Width and Height of arrow
%   C = Arrow color 
%   A = Percent distance between center and stem edge
%   B = Percent distance between stem end and begining of arrow head

% 20080229 jpaul@vims.edu

% Check inputs
if ~exist('c','var');c = 'k';end
if ~exist('a','var');a = 2/3;end
if ~exist('b','var');b = 1/3;end

% Check size consistency of inputs
nX=numel(x);nY=numel(y);nW=numel(w);nH=numel(h);nA=numel(a);nB=numel(b);
nTot = [nX nY nW nH nA nB];

if any(diff(nTot(nTot~=1))); error('Size mismatch in Arguments'); end

% Convert inputs to same size
sizeArrows = [max(nTot) 1];
if any(nTot~=max(nTot))
    if nX == 1; x = x * ones(sizeArrows); else x = x(:); end
    if nY == 1; y = y * ones(sizeArrows); else y = y(:); end
    if nW == 1; w = w * ones(sizeArrows); else w = w(:); end
    if nH == 1; h = h * ones(sizeArrows); else h = h(:); end
    if nA == 1; a = a * ones(sizeArrows); else a = a(:); end
    if nB == 1; b = b * ones(sizeArrows); else b = b(:); end
end

% Calculate some distances
w2 = w/2;  wb = w.*(b-0.5);
h2 = h/2;  ah = a.* h2;

% Create the patches
xp = [x-w2 x-w2 x+wb x+wb x+w2 x+wb x+wb x-w2];
yp = [y-ah y+ah y+ah y+h2 y    y-h2 y-ah y-ah];

h = fill(xp',yp',c);



