%% %% syntaxe : path draw_arrow
%% /draw_arrow {
%% gsave
%% [] 0 setdash
%% 4 dict begin
%% /path exch def
%% path cpathendpoint /A defpoint
%% path cpathstartpoint /B defpoint
%% path cpathpointstable /table exch def
%% /alpha ahangle 2 div def
%% /ligne0 table {A alpha rotatepoint} papply def
%% /ligne1 table {A alpha neg rotatepoint} papply def
%% ligne0 0 getp /C0 defpoint
%% ligne1 0 getp /C1 defpoint
%% B C0 C1 axesympoint /C2 defpoint
%% newpath
%% C0 smoveto
%% ligne0 ligne_brisee_
%% ligne1 reversep ligne_brisee_
%% ahcoeff 0 ne {
%% C2 B C2 vecteur ahcoeff mulv addv slineto
%% } if
%% closepath
%% gsave fill grestore
%% stroke
%% end
%% grestore
%% } def
%% syntaxe : path draw_arrow
/draw_arrow {
gsave
[] 0 setdash
4 dict begin
/path exch cpathtocppath def
path cpathendpoint /A defpoint
path cpathstartpoint /B defpoint
path cpathpointstable /table exch def
/alpha ahangle 2 div def
/ligne0 table {A alpha rotatepoint} papply {ptojpoint} papply def
/ligne1 table {A alpha neg rotatepoint} papply {ptojpoint} papply def
ligne0 0 getp /C0 defpoint
ligne1 0 getp /C1 defpoint
B ptojpoint C0 C1 axesympoint /C2 defpoint
newpath
C0 smoveto
ligne0 ligne_brisee_
ligne1 reversep ligne_brisee_
ahcoeff 0 ne {
C2 B ptojpoint C2 vecteur ahcoeff mulv addv slineto
} if
closepath
gsave fill grestore
stroke
end
grestore
} def
|