[pstricks] Large numbers in double multido and memory problems

Poul Riis Poul.Riis at skolekom.dk
Fri Nov 9 20:47:32 CET 2007


How can I increase the number of points in the double slit interference
pattern below without getting memory problems?
Any other improvements will be appreciated, too...

Yours,
Poul Riis


\documentclass{article}
\usepackage[x11names]{xcolor}
\usepackage{pstricks-add}
\usepackage{geometry}

\definecolor[ps]{bl}{rgb}{tx at addDict begin Red Green Blue end}

\begin{document}
\psset{unit=1pt}
\begin{pspicture}(0,0)(60,50)
\multido{\iy=1+1}{50}{\multido{\ix=1+1}{60}{\pstVerb{/r1 \ix\space dup mul
\iy\space 35 sub dup mul add sqrt def /r2 \ix\space dup mul \iy\space 15
sub dup mul add sqrt def r1 10 div 360 mul sin r2 10 div 360 mul sin add 2
add 75 mul 379 add dup /lambda exch def tx at addDict begin wavelengthToRGB
end}\psframe*[linecolor=bl](!\ix\space 1 sub \iy\space 1 sub)(!\ix\space
\iy\space)}}
\end{pspicture}
\end{document}




More information about the PSTricks mailing list