2

Behavior of nodes defined pst-eucl seems to be different from those defined in pst-plot.

In the section titled Direct node, I attempted to create a square with pq as it base inclined at a slope of line pq. Unfortunately, it produces a wrong output.

But if I buffered the rotated point with a node defined in pst-node, I got the correct output.

This inconsistent behavior might cause confusion and difficult to debug. What do you think?

\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{pst-eucl}
\begin{document}

\section*{Direct node}
\begin{pspicture}[showgrid,saveNodeCoors,NodeCoorPrefix=N](10,10)
    \pstGeonode(4,8){p}(4,6){r}
    \pstRotation[RotAngle=90]{p}{r}[q]
    \rput{!Nqy Nry sub Nqx Nrx sub atan}(r){\psframe(!Nqx Nqy Nrx Nry Pyth2 dup)}
\end{pspicture}

\vspace{4cm}
\section*{Indirect node}
\begin{pspicture}[showgrid,saveNodeCoors,NodeCoorPrefix=N](10,10)
    \pstGeonode(4,8){p}(4,6){r}
    \pstRotation[RotAngle=90]{p}{r}[temp]
    \pnodes(temp){q}
    \rput{!Nqy Nry sub Nqx Nrx sub atan}(r){\psframe(!Nqx Nqy Nrx Nry Pyth2 dup)}
\end{pspicture}

\end{document}

enter image description here

Question

Why do we need to buffer the pst-eucl nodes before passing them to \rput? Why don't make the behavior of nodes defined in pst-eucl consistent with those defined in pst-plot?

3

Your code without an intermediate node doesn't work, because \pstRotation internally uses \rput.

When a node is shifted with \rput, the coordinates saved with saveNodeCoors cannot be used together with other coordinates of nodes defined outside of the \rput (see How do we explain the behavior of \rput, \psGetNodeCenter and saveNodeCoors? for a more detailled explanation).

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.