[pstricks] Calculer distances entre nœuds avec Pstricks

Herbert Voss herbert49 at googlemail.com
Wed Sep 3 18:03:52 CEST 2008

agodemar schrieb:

> Thank you for this code above, but I think you understand now that my
> problem
> is a little bit more general: I would like to measure things coming
> from outside
> using psfrag and pstricks (and fp if necessary).

there is an easy but not short solution, you have to rewrite
the existing macros:

\psArc[options]{arrows}(center)(node B for radius A-B){alpha}{beta}

[options] and {arrows} are both optional.



\def\psArc{\pst at object{psArc}}
\def\psArc at i{\@ifnextchar({\psArc at iii}{\psArc at ii}}
\def\psarc at ii#1{\addto at par{arrows=#1}%
   \@ifnextchar({\psArc at iii}{\psArc at iii(0,0)}%
\def\psArc at iii(#1)(#2)#3#4{%
   \begin at OpenObj
     \pst at getangle{#3}\pst at tempa
     \pst at getangle{#4}\pst at tempb
     \ifx\pst at tempa\pst at tempb \else
       \addto at pscode{\psArc at iv{#1}{#2} \psarc at v}%
       \gdef\psarc at type{0}%
   \end at OpenObj%
\def\psArc at iv#1#2{%
   \pst at coor /y ED /x ED
   /r \pstDistAB{#1}{#2} def
   /c 57.2957 r \tx at Div def
     \pst at tempa
     \psk at arcsepA c mul 2 div
     \ifcase\psarc at type add \or sub \fi
     \pst at tempb
     \psk at arcsepB c mul 2 div
     \ifcase\psarc at type sub \or add \fi
   \ifshowpoints\psarc at showpoints\fi
   \ifx\psk at arrowA\@empty
     \ifnum\psk at liftpen=2
       r angleA \tx at PtoC
       y add exch x add exch moveto




More information about the PSTricks mailing list