Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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}
share|improve this answer
    
Actually the question I posted is to be my experiment how to use dictionaries. –  Oh my ghost Mar 13 '13 at 21:56
    
then use another simple example ... –  Herbert Mar 13 '13 at 22:02
    
Ok. Now the codes have been simplified. –  Oh my ghost Mar 13 '13 at 22:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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