[metapost] Arrows in the middle of a path

Oliver Buerschaper oliver.buerschaper at mpq.mpg.de
Mon Jul 28 17:37:01 CEST 2008

Dear MetaPost wizards,

how can I draw an arrow head right at the middle of a path? So far  
I've tried

u := 1cm;

path p;
p := origin -- (0,u);
t := .6;
drawarrow subpath(0,t) of p;
draw subpath(t,1) of p;

but this looks somewhat clumsy. Also, it'll be tedious to repeat the  
construction for an arbitrary path … so I was wondering whether one  
can define a draw command like "drawarrow p" that places the arrow  
head at the middle of an arbitrary path p rather than at its endpoint?

Thanks for your help,

More information about the metapost mailing list