[texhax] [pstricks] using postscript functions

Herbert Voss LaTeX at zedat.fu-berlin.de
Tue May 30 20:03:29 CEST 2006


Fred Moore wrote:

> I should like to be able to calculate a point in a pspicture.
> For example a random point, such as should be shown in
> the second picture --- if it would compile.

\documentclass{article}
\usepackage{pstricks,pst-plot,multido}
\SpecialCoor
\begin{document}

\noindent
\psset{unit=10pt,arrowsize=2.5pt 3}
\pspicture(+23.5,+12.0)
\psframe[linewidth=0.4pt,linecolor=green](+23.5,+12.0)
\parametricplot[plotpoints=500,linewidth=0.2pt,plotstyle=dots,
linecolor=blue]{0}{2}{rand 2350 mod 100 div rand 1200 mod 100 div}
\endpspicture

\vskip10pt
\noindent
\psset{unit=10pt,arrowsize=2.5pt 3}
\pspicture(0,0)(+23.5,+12.0)
\psframe[linewidth=0.4pt,linecolor=green](0,0)(+23.5,+12.0)
\multido{\iA=1+1}{30}{%
   \rput(! rand 2350 mod 100 div rand 1200 mod 100 div){X}}
\endpspicture

\end{document}

Fred,

\rput(! ... ) leaves two values (x y) on the stack.

Herbert




More information about the texhax mailing list