[pstricks] First try with \multido

Scott, Randy Scott_Randy at sccollege.edu
Thu Nov 5 19:45:53 CET 2015

Hi,

I am trying to create a scalable polar grid in PSTricks. This is my first attempt at using \multido. I get the circles and angle labels just fine, but I'm having a hard time with the dotted rays at multiples of pi/12.

I cannot seem to get the cosine and sine of \iRay to compute. I've tried RPN and algebraic, but neither want to work.

Any suggestions would be appreciated.

Randy Scott
Santiago Canyon College
Orange, CA

\documentclass[pstricks]{standalone}

\usepackage{pst-solides3d, pst-math, pst-3dplot}

\begin{document}

\SpecialCoor %PSTricks polar coordinates

\psset{xunit=2cm, yunit=2cm}

\begin{pspicture}(-3.5,-3.5)(3.5,3.5)

\psaxes[ticksize=2pt, labels=none]{->}(0,0)(-3.1,-3.1)(3.2,3.2)

\multido{\iAngle=15+15, \n=1+1}{5}{\rput(3.3\psxunit;\iAngle){\scriptsize $\frac{\n\pi}{12}$}}

\multido{\iAngle=105+15, \n=7+1}{5}{\rput(3.3\psxunit;\iAngle){\scriptsize $\frac{\n\pi}{12}$}}

\multido{\iAngle=195+15, \n=13+1}{5}{\rput(3.3\psxunit;\iAngle){\scriptsize $\frac{\n\pi}{12}$}}

\multido{\iAngle=285+15, \n=19+1}{5}{\rput(3.3\psxunit;\iAngle){\scriptsize $\frac{\n\pi}{12}$}}

\multido{\r=1+1}{3}{\pscircle[linewidth=0.5pt](0,0){\r\psxunit}}

\multido{\iRay=15+15 }{5}{\psline[linestyle=dotted, linewidth=0.5pt](0;0)(\iRay; \iRay)}

\multido{\iRay=105+15 }{5}{\psline[linestyle=dotted, linewidth=0.5pt](0;0)(\iRay;\iRay)}

\multido{\iRay=195+15 }{5}{\psline[linestyle=dotted, linewidth=0.5pt](0;0)(\iRay;\iRay)}

\multido{\iRay=285+15 }{5}{\psline[linestyle=dotted, linewidth=0.5pt](0;0)(\iRay ;\iRay)}

\end{pspicture}

\end{document}