[pstricks] Current point

Hensh, Richard hensh at math.msu.edu
Tue Dec 4 19:49:26 CET 2007


Is there a way to move the current point without relying on the \pscustom environment (which doesn't seem to work)? For example, I have written the following postscript:

\pstVerb{%
        /polar@ {dup cos 3 1 roll sin 3 1 roll dup 4 1 roll mul 3 1 roll mul} def % (r,theta) -> (x,y)
  }

Now, I can specify the rectangular point (\sqrt{3},1) using:

\pnode(!2 30 polar@){A}

which is just fine whenever I want the point (0,0) to be the current point. Now suppose that I wish to measure a 30 degree angle from some other point. Then I find myself using the \pstTranslation macro, which can become very tedious.

For example, in the code at the end of this message, I wish to draw a line DE parallel to AC.

I would prefer something like:

\cp(2,0)        %%Now (2,0) is the current point.
\pnode(!6 60 polar@){C}
\cp(0,0)        %%The default

instead of

 \pnode(!6 60 polar@){C}
 \pstTranslation{A}{D}{C}

as shown below. It's not a big deal but it would be nice.

Thanks
Ricky

\documentclass[12pt]{article}
\usepackage{pst-eucl}%
\usepackage{pstricks-add}%

\begin{document}
\psset{unit=6mm}
\psset{%
    PointSymbol=none%
    ,PointName={}%
    }
\begin{pspicture}(\-1,-1)(8,6)
    \SpecialCoor
        \pnode(0,0){A}
        \pnode(!6 60 polar@){C}
        \pnode(7,0){B}
        \pnode(2,0){D}
        \pstTranslation{A}{D}{C}
        \pstInterLL{D}{C'}{B}{C}{E}
        \psline(A)(B)(C)(A)
        \psline(D)(E)
        \uput{6pt}[180](A){{$A$}}
        \uput{6pt}[0](B){{$B$}}
        \uput{6pt}[90](C){{$C$}}
        \uput{6pt}[-90](D){{$D$}}
        \uput{6pt}[45](E){{ $E$}}
    \NormalCoor
\end{pspicture}

\end{document}



More information about the PSTricks mailing list