[pstricks] Current point

Hensh, Richard hensh at math.msu.edu
Wed Dec 5 22:47:05 CET 2007


Thanks for letting me know about the macro: psRelLine.

There are some other situations were the code you suggested would not be convenient. After some thought I came up with

\makeatletter
\def\pNode(#1)(#2)#3{%
      \pnode(0,0){tmpO@}%
      \pnode(#1){tmpP@}%
      \pnode(#2){tmpQ@}%
      \pstTranslation{tmpO@}{tmpP@}{tmpQ@}[#3]
    }
\makeatother

Now

\pNode(1,0)(3;60){C}

gives me a named node C relative to (1,0).

If you see any potential problems, please let me know.

Thanks,
Ricky

PS. As always thanks for all of your help.



-----Original Message-----
From: pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] On Behalf Of Herbert Voss
Sent: Tuesday, December 04, 2007 3:50 PM
To: Graphics with PSTricks
Subject: Re: [pstricks] Current point

Hensh, Richard schrieb:
> 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}

\pnode(2;30){A} does the same

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

there is an easier way:

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

\begin{document}
\psset{unit=6mm}
\psset{PointSymbol=none,PointName={}}
\begin{pspicture}(-1,-1)(8,6)
   \pstTriangle(0,0){A}(7,0){B}(6;60){C}
   \psRelLine(B)(A){0.75}{D}
   \psRelLine(B)(C){0.75}{E}
   \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$}}
\end{pspicture}

\end{document}


Herbert
_______________________________________________
pstricks mailing list
pstricks at tug.org
http://tug.org/mailman/listinfo/pstricks



More information about the PSTricks mailing list