[pstricks] plotting in polar coordinates

Jean-Côme Charpentier Jean-Come.Charpentier at wanadoo.fr
Mon Jun 20 02:17:35 CEST 2005


juanleal at cantv.net wrote:
> Thank you Mr. Etienne and Mr. Alan.
> [...]
> I rewrote your solution for r^2=3cos(2t) in this way
> 
> \parametricplot{-45}{45}{2 t mul cos 3 mul sqrt\space t cos mul 2 t mul 
> cos 3 mul sqrt\space t sin mul}

\space isn't needed here (see explanation below).

> [...]
> 
> I noticed that if we delete the command \space in your solution it 
> doesn't work: I didn't know that we can use any other thing but the 
> definition of the functions in the argument of the plot commands.
> 
> Please could you tell me about the use of the command \space, or any 
> other of the same type, in the argument of \psplot or \paremetricplot?

The \psplot or \parametricplot argument is expanded like other macros in 
the TeX world. In particular,
   \rau dup t cos ...
will be expanded as
   2 t mul cos 3 mul sqrtdup t cos
(assume \rau means "2 t mul cos 3 mul sqrt") with no space between sqrt 
and dup. That's because macro eat spaces that follow. Usualy, PostScript 
don't like operator sqrtdup :-)

Another solution is to define \rau as

\newcommand\rau{2 t mul cos 3 mul sqrt }

that is, with a space after "sqrt".

   Jean-Côme Charpentier




More information about the PSTricks mailing list