[pstricks] Re: Length in Pstricks

Herbert Voss Herbert.Voss at gmx.net
Sat Jan 28 23:49:52 CET 2006

Gabriel Guernik wrote:

> I don't really get it, why is that it only makes sense for an origin
> (0,0)? The command you describe should do the same as \pstArcOAB, but
> there would another parameter: another node to calculate the radius,
> that is, the distance from "O" to "nodeA for r".Can that be done?
> Anyway, if that is not posible, I can get the angles, I would need a
> command
> \psArcOA(O)(A){angleA}{angleB}

this is possible with redefining the main macro.



\def\psArc{\pst at object{psArc}}
\def\psArc at i(#1)(#2)#3#4{%
   \begin at OpenObj
     \pst at getangle{#3}\pst at tempa
     \pst at getangle{#4}\pst at tempb
     \pst at getcoor{#1}\pst at tempA%
     \pst at getcoor{#2}\pst at tempB%
     \addto at pscode{\psArc at iv \psarc at v}%
     \gdef\psarc at type{0}%
   \end at OpenObj%
\def\psArc at iv{%
   \pst at tempA \space exch \pst at tempB \space 4 1 roll
   sub 3 1 roll sub Pyth pstack /r exch def
   \pst at tempA /y ED /x ED
   /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