下列 PS 表达式中半径过长的原因是什么?

下列 PS 表达式中半径过长的原因是什么?

我想翻译

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

来自以下

在此处输入图片描述

\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}

 \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}%

用于

在此处输入图片描述

\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}

我的错误是什么导致半径太长?

Pyth2 \pst@number\psrunit\space div编辑:当被 替换时,问题解决了Pyth2 236 div。但仍有一个问题,为什么是236

答案1

pst-eucl具有距离函数,那么为什么要把事情弄得这么复杂呢?

\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}

相关内容