# A weird trigonometry identity applied to get the same result

The following two input files produce the same output.

## Method 1:

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

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

-
Node is the most unpredictable creature in PSTricks! – kiss my armpit Sep 15 '12 at 14:31

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

-
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]? – kiss my armpit Sep 16 '12 at 5:06

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}

-