function out=arrowhead(xin,yin,thetain,rmag,acolour); % function out=arrowhead(xin,yin,thetain,rmag,acolour); % x,y, theta must be 1D vectors, and of same dimensions % theta is the direction of the arrowhead % the arrowheads are of length rmag % x=xin; y=yin; theta=thetain; [m,n]=size(xin); if(m>n) x=x'; y=y'; theta=theta'; end phi=pi/8; xtop=x+rmag*cos(-pi+theta-phi); ytop=y+rmag*sin(-pi+theta-phi); xbot=x+rmag*cos(-pi+theta+phi); ybot=y+rmag*sin(-pi+theta+phi); plot([x;xtop],[y;ytop],acolour); hold on plot([x;xbot],[y;ybot],acolour);