code for labeledarrow

See the previous text for explanation of the syntax. Basically
tail = [t1,t2] location of tail of arrow,

head = [h1,h2] location of head of arrow,
scalefactors =[tb,wh,hh] are factors for scaling the thickness of the shaft, width of head, and height of head,
txt is a string (usually enclosed in grave accents for safety) which is the text label of the arrow
txtshift is a pair [a,b] which shifts the center of the text from the center of the arrow an amount a*(unit vector parallel to the direction of the arrow) + b*(unit vector normal to the direction of the arrow)

size is the pointsize in TIMES, BOLD text of the text

colr is the color of the arrow

> labeledarrow:=proc(tail,head,scalefactors, text,txtshift, size, colr) local txt,tmp,nrm,dir,cntr,txtat,dirperp:
dir:=head-tail:
nrm:=sqrt( dir[1]^2+dir[2]^2):
dir:=expand((1/nrm)*dir):
dirperp:=[dir[2],-dir[1]]:
cntr:=.5*(head+tail):
txtat:=cntr+txtshift[1]* dir+txtshift[2]*dirperp:
tmp:=plottools[arrow](tail, head, scalefactors[1]*.01*nrm,scalefactors[2]*.05*nrm,scalefactors[3]*.05,color=colr):
txt:=plots[textplot]([txtat[1],txtat[2],text],font=[TIMES,BOLD,size]): plots[display]({tmp,txt});end:

> #examples
A1:=labeledarrow([1,1],[2,3],[1,1,1],`this is it`,[.2,.3],18,blue);
A2:=labeledarrow([1,1],[2,3],[1,1,1],`this is it`,[.2,-.3],18,blue);