2

I want to translate

\pstVerb{/Dist {N-A.x N-A.y N-B.x N-B.y Pyth2} def}

from the following

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-eucl}
\addtopsstyle{gridstyle}{gridlabels=0pt,griddots=0}
\psset{saveNodeCoors}
\begin{document}
\begin{pspicture}[showgrid](-2,-2)(2,2)
    \pstGeonode[PosAngle={180,45,-90}]
        (-1.5,-1){A}
        (1.5,1){B}
    \pstVerb{/Dist {N-A.x N-A.y N-B.x N-B.y Pyth2} def}%
    \pnode[A](!Dist 21 PtoC){D}\psdots(D)
    \psarc[origin={A},arcsep=-1](A){!Dist}{(D)}{(B)}
\end{pspicture}
\end{document}

to

 \pstVerb{%
        tx@Dict begin
            tx@NodeDict begin
                /N@A load GetCenter
                /N@B load GetCenter
            end
            Pyth2 \pst@number\psrunit\space div
            /Dist ED
        end}%

used in

enter image description here

\documentclass[pstricks,border={12pt 12pt 25cm 15cm}]{standalone}
\usepackage{pst-eucl}
\addtopsstyle{gridstyle}{gridlabels=0pt,griddots=0}
\makeatletter
\psset{runit=\psunit}
\begin{document}
\begin{pspicture}[showgrid](-2,-2)(2,2)
    \pstGeonode[PosAngle={180,45,-90}]
        (-1.5,-1){A}
        (1.5,1){B}
    \pstVerb{%
            tx@Dict begin
                tx@NodeDict begin
                    /N@A load GetCenter
                    /N@B load GetCenter
                end
                Pyth2 \pst@number\psrunit\space div
                /Dist ED
            end}%
    \pnode[A](!Dist 21 PtoC){D}\psdots(D)
    \psarc[origin={A},arcsep=-1](A){!Dist}{(D)}{(B)}
\end{pspicture}
\end{document}

What is my mistake caused the radius to be too long?

Edit: The problem solved when Pyth2 \pst@number\psrunit\space div is replaced by Pyth2 236 div. But it still leaves a question, why is it 236?

1

pst-eucl has a distance function so why making things so complicated?

\documentclass[pstricks,border={12pt 12pt 25cm 15cm}]{standalone}
\usepackage{pst-eucl}
\addtopsstyle{gridstyle}{gridlabels=0pt,griddots=0}
\makeatletter
\begin{document}
\begin{pspicture}[showgrid](-2,-2)(2,2)
    \pstGeonode[PosAngle={180,45,-90}](-1.5,-1){A}(1.5,1){B}(1.5,-1){C}
    \pstRightAngle[RightAngleSize=0.2,fillstyle=solid,fillcolor=green!50]{A}{C}{B}
    \pnode[A](!\pstDistAB{A}{B} 21 PtoC \tx@UserCoor){D}\psdots(D)
    \psarc[origin={A},arcsep=-1](A){!\pstDistAB{A}{B} \pst@number\psunit div}{(D)}{(B)}
    \psline[linestyle=dashed](A)(D)(D|C)(C)
    \psset{shortput=nab,labelsep=-3pt}
    \ncline{A}{B}^{$g$}
    \ncline{B}{C}^{$a$}
    \ncline{C}{A}^{$b$}
\end{pspicture}
\end{document}
  • Actually the question I posted is to be my experiment how to use dictionaries. – kiss my armpit Mar 13 '13 at 21:56
  • then use another simple example ... – user2478 Mar 13 '13 at 22:02
  • Ok. Now the codes have been simplified. – kiss my armpit Mar 13 '13 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.