Home > hiswa > fatarrow.m

fatarrow

PURPOSE ^

function [z]=fatarrow(x,y,w,color);

SYNOPSIS ^

function [z]=fatarrow(x,y,w,color);

DESCRIPTION ^

function [z]=fatarrow(x,y,w,color);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [z]=fatarrow(x,y,w,color);
0002 %function [z]=fatarrow(x,y,w,color);
0003 if(exist('color')~=1);color='y';end;
0004 x=x(:);
0005 y=y(:);
0006 w=w(:);
0007 len=abs(w);
0008 stem_width=.25*len;
0009 head_width=2.0*stem_width;
0010 head_length=0.35*len;
0011 len2=len/2;
0012 onez=ones(size(x));
0013 zeroz=zeros(size(x));
0014 x1=zeroz+(stem_width/2); y1=zeroz+(len2-head_length);
0015 x2=zeroz+(head_width/2); y2=y1;
0016 x3=zeroz;y3=zeroz+len2;
0017 x4=zeroz-(head_width/2);y4=y1;
0018 x5=zeroz-(stem_width/2);y5=y1;
0019 x6=zeroz-(head_width/3);y6=zeroz-len2;
0020 x7=zeroz+(head_width/3);y7=y6;
0021 z=[x1 x2 x3 x4 x5 x6 x7]+sqrt(-1)*[y1 y2 y3 y4 y5 y6 y7];
0022 a=angle(w);
0023 z=(x+i*y)+z*exp(-i*(pi/2-a));
0024 patch(real(z),imag(z),color)

Generated on Wed 30-Nov-2005 15:36:39 by m2html © 2003