[pstricks] including PostScript code in pstricks

Herbert Voss LaTeX at zedat.fu-berlin.de
Fri Mar 24 21:46:05 CET 2006

Germi Camps wrote:

> the begining and ending angle, and I also need to calculate theese 
> angles, as follows
> \psarc(!\rad\space 1 \rad\space add div 10 mul 0)%
>    { \radb\space 2 div 1 add }{ \rad\space 1 sub \rad\space 1 add div }{ 
> \rad\space 1 sub \rad\space 1 add div neg }
> but this doesn't work. what do I have to change in the \psarc code?
> finally, in the solution you wrote the radius is interpreted in pt, and 
> I need to write it in cm. In fact I can multilpy the number by 28,45 (pt 
> in a cm) and the output is the same, but maybe there is another way.


\def\psarc at iii(#1)#2#3#4{%
   \begin at OpenObj
     \def\pst at tempa{#3}
     \def\pst at tempb{#4}
     \def\pst at tempA{#2}%
     \addto at pscode{\psarc at iv \psarc at v}%
     \gdef\psarc at type{0}%
   \end at OpenObj%
\def\psarc at iv{%
   \pst at coor /y ED /x ED
   /r \pst at tempA\space \pst at number\psunit mul 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


\psarc(!\rad\space 1 \rad\space add div 10 mul -10)%
	{ \radb\space 2 div 1 add }
	{ \rad\space 1 sub \rad\space 1 add div RadtoDeg }
	{ \rad\space 1 sub \rad\space 1 add div RadtoDeg neg }



More information about the PSTricks mailing list