2

I am attempting to solve my own problem How to rotate the label such that its base line is parallel to the bisector? with the most elegant approach, i.e., passing a node as an angle argument of \uput.

The following cases are ordered from the less elegant (but successful) to the more elegant (but fail).

  • Case 1: Success to pass literal constants.

    enter image description here

    \documentclass[pstricks,border=15pt]{standalone}
    \usepackage{pst-eucl}
    
    \begin{document}
    
    \begin{pspicture}[showgrid](4,4)
        \pstGeonode[PosAngle={-135,90},CurveType=polyline]
            (1,1){O}
            (2,3){A}
        \pstGeonode([nodesep=2]O){X}
        \psline[linestyle=dashed](O)(X)
        \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
        \uput{1}%
        [
            !3 1 sub 2 1 sub atan
        ]
        {
            !3 1 sub 2 1 sub atan
        }(O){\textcolor{red}{$\pi-\theta$}}
    \end{pspicture}
    
    \end{document}
    
  • Case 2: Fail to use \psGetNodeCenter.

    enter image description here

    \documentclass[pstricks,border=15pt]{standalone}
    \usepackage{pst-eucl}
    
    \begin{document}
    
    \begin{pspicture}[showgrid](4,4)
        \pstGeonode[PosAngle={-135,90},CurveType=polyline]
            (1,1){O}
            (2,3){A}
        \pstGeonode([nodesep=2]O){X}
        \psline[linestyle=dashed](O)(X)
        \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(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 A.x O.x sub atan
        }(O){\textcolor{red}{$\pi-\theta$}}
    \end{pspicture}
    
    
    \end{document}
    
  • Case 3: Fail to pass a node.

    enter image description here

    \documentclass[pstricks,border=15pt]{standalone}
    \usepackage{pst-eucl}
    
    \begin{document}
    
    \begin{pspicture}[showgrid](4,4)
        \pstGeonode[PosAngle={-135,90},CurveType=polyline]
            (1,1){O}
            (2,3){A}
        \pstGeonode([nodesep=2]O){X}
        \psline[linestyle=dashed](O)(X)
        \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
        \uput{1}[(A)]{(A)}(O){\textcolor{red}{$\pi-\theta$}}
    \end{pspicture}    
    
    \end{document}
    

How to pass a node as the angle argument of \uput?

2
+50
\documentclass{article}
\usepackage{pst-eucl}
\begin{document}

\begin{pspicture}[showgrid](4,4)
    \pstGeonode[PosAngle={-135,90}](1,1){O}(2,3){A}
    \pstGeonode([nodesep=2]O){X}
    \psline[linestyle=dashed](O)(X)
    \psarc[origin={O},linecolor=red]{->}(O){0.5}{(X)}{(A)}
    \pcline(O)(A)\ncput*[nrot=:U]{\textcolor{red}{$\pi-\theta$}}
\end{pspicture}    

\end{document}

enter image description here

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.