3

I want to rotate point B 30 degrees counterclockwise about A to produce a new point C. However, I failed to get the correct C as illustrated below. The red circle helps us to notice the issue easily.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-eucl}
\psset{saveNodeCoors}
\begin{document}
\begin{pspicture}[showgrid](6,6)
    \pstGeonode
        (1,1){A}
        (5,3){B}
        (!N-B.y N-A.y sub 2 exp  N-B.x N-A.x sub 2 exp add sqrt N-B.y N-A.y sub N-B.x N-A.x sub atan 30 add PtoC){C}
    \pstCircleOA[linecolor=red]{A}{B}
\end{pspicture}
\end{document}

enter image description here

Notes

Don't suggest me to use \pstRotation as I already know it and it is not my interest. You might suggest me to use ([angle=30,nodesep=]{B}A), but the problem is that nodesep must be assigned with an absolute value. It might be a good idea to add a new key, for example, relnodesep to ([angle=30,...]{B}A) syntax so we can solve this problem by just writing ([angle=30,relnodesep=1]{B}A).

8
+150

You only rotate the difference vector between node A and B, but at the end you must add the coordinates of the 'origin' A:

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-eucl}
\psset{saveNodeCoors}
\begin{document}
\begin{pspicture}[showgrid](6,6)
    \pstGeonode
        (1,1){A}
        (5,3){B}
        (!N-B.y N-A.y sub 2 exp  N-B.x N-A.x sub 2 exp add sqrt 
          N-B.y N-A.y sub N-B.x N-A.x sub atan 30 add PtoC 
          N-A.y add exch N-A.x add exch % this was missing
        ){C}
    \pstCircleOA[linecolor=red]{A}{B}
\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.