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.

The following two input files produce the same output.

Method 1:

enter image description here

\documentclass[pstricks,border=15pt]{standalone}
\usepackage{pst-eucl}
\psset{PosAngle={-135,90},CurveType=polyline}

\begin{document}

\begin{pspicture}[showgrid=false](4,4)
\pstGeonode
    (1,1){O}
    (4,3){A}
\uput{1}%
    [!3 1 sub 4 1 sub atan]
    {!3 1 sub 4 1 sub atan}(O){$\pi-\theta$}
\end{pspicture}

\end{document}

Method 2:

enter image description here

\documentclass[pstricks,border=15pt]{standalone}
\usepackage{pst-eucl}
\psset{PosAngle={-135,90},CurveType=polyline}

\begin{document}

\begin{pspicture}[showgrid=false](4,4)
\psset{linecolor=red}
\pstGeonode
    (1,1){O}
    (4,3){A}
\uput{1}%
    [!\psGetNodeCenter{A}\psGetNodeCenter{O} A.y O.y sub A.x O.x sub atan]
    {!\psGetNodeCenter{A}\psGetNodeCenter{O} A.y O.y sub neg A.x O.x sub atan}(O){$\pi-\theta$}
\end{pspicture}    

\end{document}

The question is why do I have to express 3 1 sub 4 1 sub atan in the first method as A.y O.y sub neg A.x O.x sub atan in the second method while

A.y equals to 3

O.y equals to 1

A.x equals to 4

O.x equals to 1

?

In other words, why do I need to add neg for the first argument of atan in the second method?

share|improve this question
    
Node is the most unpredictable creature in PSTricks! –  I am who I say I am Sep 15 '12 at 14:31
add comment

2 Answers

up vote 2 down vote accepted

Nodes are saved in an own dictionary which also saves the current transformation matrix which is restored when using \psGetNodeCenter. To rotate back you have to use the negative rotation angle:

{!\psGetNodeCenter{A}\psGetNodeCenter{O} A.y O.y sub A.x O.x sub atan neg}(O){$\pi-\theta$}

neg must be used at the end. However it gives the same result when using for y

share|improve this answer
    
One question: but why don't we need neg in [!\psGetNodeCenter{A}\psGetNodeCenter{O} A.y O.y sub A.x O.x sub atan]? –  I am who I say I am Sep 16 '12 at 5:06
add comment

With the latest PSTricks packages, the problem no longer exists.

\documentclass[pstricks,border=15pt]{standalone}
\usepackage{pst-eucl}
\psset{PosAngle={-135,90},CurveType=polyline}

\begin{document}

\begin{pspicture}[showgrid=false](4,4)
\psset{linecolor=red}
\pstGeonode
    (1,1){O}
    (4,3){A}
\uput{1}%
    [!N-A.y N-O.y sub N-A.x N-O.x sub atan]
    {!N-A.y N-O.y sub N-A.x N-O.x sub atan}(O){$\pi-\theta$}
\end{pspicture}    

\end{document}
share|improve this answer
add comment

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.