[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.

\psArc[settings](center)(refNode){angelA}{ANgleB}

Herbert

\listfiles
\documentclass{article}
\usepackage{pst-node}
\SpecialCoor
\makeatletter
\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}%
     \showpointsfalse
   \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
   /angleA
     \pst at tempa
     \psk at arcsepA c mul 2 div
     \ifcase \psarc at type add \or sub \fi
   def
   /angleB
     \pst at tempb
     \psk at arcsepB c mul 2 div
     \ifcase \psarc at type sub \or add \fi
   def
   \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
     \fi
   \fi}
\makeatother

\begin{document}

\begin{pspicture}[showgrid=true](5,5)
   \pnode(1,1){O}\pnode(5;10){A}\pnode(5;80){B}
   \qdisk(O){2pt}\qdisk(A){2pt}\qdisk(B){2pt}
   \uput[45](O){O}\uput[-145](A){A}\uput[-90](B){B}
   \psArc[arrows=<->](O)(A){-10}{100}
\end{pspicture}

\end{document}



-- 
http://PSTricks.de/
http://TeXnik.de/
http://www.dante.de/CTAN/info/math/voss/mathmode/Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes





More information about the PSTricks mailing list