[pstricks] state of the random generator

jmpapy Jean-Michel.Papy at esat.kuleuven.ac.be
Thu Oct 7 16:30:08 CEST 2004


Herbert, in the piece of code :
\pstVerb{
rrand srand % initializes the random generator
}

you initializes the random generator. When I LaTeX the document I always 
obtain the same sequence. Therefore I conclude that I start with the 
same initial state every time. This point is OK to me.

But in order to obtain a different sequence I would want to manually set 
another initial state. How can I proceed ?

thanks,
JM

> > something like this??
> > 
> > Herbert
> > 
> > \documentclass[a4paper,10pt]{article}
> > \usepackage{pstricks,pstricks-add}
> > \begin{document}
> > 
> > \pstVerb{
> >    rrand srand % initializes the random generator
> > }
> > \begin{pspicture}(-5,-0.2)(5,5)
> > \psline{-}(-5,0)(5,0)
> >
> \psplot[linecolor=red,plotpoints=50,showpoints=true,linestyle=none]
> {-1}{3}{%
> >    4.7 39.48 x 1 neg add 2 exp mul 1 2 exp add div
> >    rand          % a random integer 0...2^31 - 1
> >    2147483647    % 2^31 - 1
> >    div add       % now rand is between 0...1
> > }
> > \end{pspicture}
> > 
> > \vspace{1cm}
> > \begin{pspicture}(-5,-0.2)(5,5)
> > \psline{-}(-5,0)(5,0)
> >
> \psplot[linecolor=red,plotpoints=50,showpoints=true,linestyle=none]
> {-1}{3}{%
> >    4.7 39.48 x 1 neg add 2 exp mul 1 2 exp add div
> >    rand 2147483647 div add %
> > }
> > \end{pspicture}
> > 
> > \end{document}
> > 
> > 
> > 
> > -- 
> > http://TeXnik.de/
> > http://PSTricks.de/
> > ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
> > http://www.dante.de/faq/de-tex-faq/
> > http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
> > 
> > _______________________________________________
> > pstricks mailing list
> > pstricks at tug.org
> > http://tug.org/mailman/listinfo/pstricks
> > 
> 
> 
> 
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> 






More information about the PSTricks mailing list