# What is lacking in my geometric calculation below?

The objective is to align the baseline of a label with the bisector. I want to summarize 4 possible tricks as follows. Let me know if there is another trick beyond my consideration.

## The first trick:

Here I use \rput{(B)}(0,0){\mylabel} and the objective is well done.

\documentclass[pstricks,border=3pt,multi,12pt]{standalone}
\usepackage{pst-eucl}
\psset
{
saveNodeCoors,
CurveType=polyline,
PointName=none,
PointSymbol=none,
LabelSep=1,
}

\newcommand{\mylabel}{$\scriptscriptstyle180^\circ-\theta$}

\begin{document}

\begin{pspicture}(6,6)
\pstGeonode(1,1){A}(5,5){B}(4,1){C}
\pstMarkAngle{A}{B}{C}{\rput{(B)}(0,0){\mylabel}}
\rput(3,5.5){\tiny rput\{(B)\}}
\end{pspicture}

\end{document}


## The second trick:

I use \rput{!\psGetNodeCenter{B} B.y B.x atan}(0,0){\mylabel} and the objective is also well done.

\documentclass[pstricks,border=3pt,multi,12pt]{standalone}
\usepackage{pst-eucl}
\psset
{
saveNodeCoors,
CurveType=polyline,
PointName=none,
PointSymbol=none,
LabelSep=1,
}

\newcommand{\mylabel}{$\scriptscriptstyle180^\circ-\theta$}

\begin{document}

\begin{pspicture}(6,6)
\pstGeonode(1,1){A}(5,5){B}(4,1){C}
\pstMarkAngle{A}{B}{C}{\rput{!\psGetNodeCenter{B} B.y B.x atan}(0,0){\mylabel}}
\rput(3,5.5){\tiny rput\{!psGetNodeCenter\{B\} B.y B.x atan\}}
\end{pspicture}

\end{document}


## The third trick:

I use the numerical literal of node B, \rput{!5 5 atan}(0,0){\mylabel} and I failed.

\documentclass[pstricks,border=3pt,multi,12pt]{standalone}
\usepackage{pst-eucl}
\psset
{
saveNodeCoors,
CurveType=polyline,
PointName=none,
PointSymbol=none,
LabelSep=1,
}

\newcommand{\mylabel}{$\scriptscriptstyle180^\circ-\theta$}

\begin{document}

\begin{pspicture}(6,6)
\pstGeonode(1,1){A}(5,5){B}(4,1){C}
\pstMarkAngle{A}{B}{C}{\rput{!5 5 atan}(0,0){\mylabel}}
\rput(3,5.5){\tiny rput\{!5 5 atan\}}
\end{pspicture}

\end{document}


## The fourth trick:

I use the saved coordinates of node B, \rput{!N-B.y N-B.x atan}(0,0){\mylabel} and I failed.

\documentclass[pstricks,border=3pt,multi,12pt]{standalone}
\usepackage{pst-eucl}
\psset
{
saveNodeCoors,
CurveType=polyline,
PointName=none,
PointSymbol=none,
LabelSep=1,
}

\newcommand{\mylabel}{$\scriptscriptstyle180^\circ-\theta$}

\begin{document}

\begin{pspicture}(6,6)
\pstGeonode(1,1){A}(5,5){B}(4,1){C}
\pstMarkAngle{A}{B}{C}{\rput{!N-B.y N-B.x atan}(0,0){\mylabel}}
\rput(3,5.5){\tiny rput\{!N-B.y N-B.x atan\}}
\end{pspicture}

\end{document}


## Question:

Herbert had said that there is an inverse transformation that I have to think about when working with \rput and \psGetNodeCenter. I forgot the exact statement and the link.

Shortly speaking, what is lacking in my PostScript expression for the 3rd and 4th tricks?

-
I think the question to be asked is why the first two tricks actually work. Do you have the documentation for them? –  A.Ellett Feb 12 '13 at 2:41
The problem with the second two tricks is that the angle is not being calculated with respect to the position of the vertex and the "center" of the circle. –  A.Ellett Feb 12 '13 at 2:42
@A.Ellett: There is no documentation. I got it by a trial and error approach. –  kiss my armpit Feb 12 '13 at 2:42
The first two seem to work because a vector is being calculated from the position of the "center" of the angle to the vertex of the angle. Thus the alignment works. –  A.Ellett Feb 12 '13 at 2:42
Also, while \pstMarkAngle{A}{B}{C}{\rput{(B)}(0,0){\mylabel}} works, \pstMarkAngle{A}{B}{C}{\rput{(5,5)}(0,0){\mylabel}} doesn't. .... which kind of debunks my vector idea. –  A.Ellett Feb 12 '13 at 2:47

In both instances, you're only calculating the angle relative to (0,0) which, for B (or (5,5)) is @ 45 degrees. That's why the angle mark is lighting up with the 45 degree line segment AB. Here are the ways to correctly implement options #3 and #4:

## The third trick:

\documentclass[pstricks,border=3pt,multi,12pt]{standalone}
\usepackage{pst-eucl}% http://ctan.org/pkg/pst-eucl
\psset
{
saveNodeCoors,
CurveType=polyline,
PointName=none,
PointSymbol=none,
LabelSep=1,
}

\newcommand{\mylabel}{$\scriptscriptstyle180^\circ-\theta$}

\begin{document}

\begin{pspicture}(6,6)
\pstGeonode(1,1){A}(5,5){B}(4,1){C}
\pstMarkAngle{A}{B}{C}{\rput{!5 5 atan 5 1 sub 5 4 sub atan add 2 div}(0,0){\mylabel}}
\rput(3,5.5){\tiny rput\{!5 5 atan\}}
\end{pspicture}

\end{document}


## The fourth trick:

\documentclass[pstricks,border=3pt,multi,12pt]{standalone}
\usepackage{pst-eucl}% http://ctan.org/pkg/pst-eucl
\psset
{
saveNodeCoors,
CurveType=polyline,
PointName=none,
PointSymbol=none,
LabelSep=1,
}

\newcommand{\mylabel}{$\scriptscriptstyle180^\circ-\theta$}

\begin{document}

\begin{pspicture}(6,6)
\pstGeonode(1,1){A}(5,5){B}(4,1){C}
\pstMarkAngle{A}{B}{C}{\rput{!N-B.y N-B.x atan N-B.y N-C.y sub N-B.x N-C.x sub atan add 2 div}(0,0){\mylabel}}
\rput(3,5.5){\tiny rput\{!N-B.y N-B.x atan\}}
\end{pspicture}

\end{document}


In essence, both methods calculate the average angle between the two line segments AB and CB:

• Line segment AB (relative to the origin (0,0)) is @ angle 45 (or 5 5 atan);
• Line segment BC (relative to the origin (0,0)) is @ angle arctan (5-1)/(5-4) = arctan 4/1 (or 4 1 arctan).

In method four, a more symbol approach is used, namely the saved node coordinates. Both methods and with an average of the two angles between line segment AB and BC, hence the use of add 2 div.

-