[Tex/LaTex] How to draw a irregular circle(shape)

macrospgfplotstikz-pgf

I want to draw some irregular circle(shape) in my wireless scenario.

with a basestation in the center.

around is some irregular circle(shape).

I find something(could be used) in this web(but I feel it's size is too large)


Now my teacher want me use this circle as small as possible, but I find when I turn the radius smaller, the irregularcicle's round isn't clear so much. Is there any idea to solve this problem?

Best Answer

With PSTricks (just for typing exercise).

Single

enter image description here

  • Verbose:

    \documentclass[pstricks,border=12pt]{standalone}
    \usepackage{pst-node,pst-plot}
    \pstVerb{realtime srand}
    \psset{plotpoints=50}
    \def\points{}
    
    \begin{document}
    \begin{pspicture}(-2,-2)(2,2)
        \curvepnodes{0}{360}{Rand 1.50 add t PtoC}{X}
        \multido{\i=0+1}{\Xnodecount}{\xdef\points{\points (X\i)}}
        \expandafter\psccurve\points
    \end{pspicture}
    \end{document}
    
  • Compact:

    \psnccurve is a new macro (among others) in pst-node to pass an array of nodes to \psccurve without creating the concatenating macro \points (as used in the code above). Now I can save more keystrokes.

    \documentclass[pstricks,border=12pt]{standalone}
    \usepackage{pst-node,pst-plot}
    \pstVerb{realtime srand}
    \psset{plotpoints=50}
    
    \begin{document}
    \begin{pspicture}(-2,-2)(2,2)
        \curvepnodes{0}{360}{Rand 1.50 add t PtoC}{X}
        \psnccurve(0,\Xnodecount){X}
    \end{pspicture}
    \end{document}
    

Multiple

enter image description here

  • Verbose:

    \documentclass[pstricks,border=12pt]{standalone}
    \usepackage{pst-node,pst-plot}
    \pstVerb{realtime srand}
    \psset{plotpoints=50}
    
    \begin{document}
    \psLoop{10}{%
    \begin{pspicture}(-2,-2)(2,2)
        \curvepnodes{0}{360}{Rand 1.50 add t PtoC}{X}
        \def\points{}% empty for each iteration
        \multido{\i=0+1}{\Xnodecount}{\xdef\points{\points (X\i)}}
        \expandafter\psccurve\points
    \end{pspicture}}
    \end{document}
    
  • Compact:

    \documentclass[pstricks,border=12pt]{standalone}
    \usepackage{pst-node,pst-plot}
    \pstVerb{realtime srand}
    \psset{plotpoints=50}
    
    \begin{document}
    \psLoop{10}{%
    \begin{pspicture}(-2,-2)(2,2)
        \curvepnodes{0}{360}{Rand 1.50 add t PtoC}{X}
        \psnccurve(0,\Xnodecount){X}
    \end{pspicture}}
    \end{document}
    

Notes

\psnline, \psncurve, and \psnccurve are available but \psnpolygon is not.

Attention

Note that Rand no longer produces a random real number between 0 and 0.5 inclusive. Its definition had been tacitly changed. Now it produces a random real number between 0 and 1 inclusive. It is not documented, nor announced, but it is still fun!

The code given above has not been updated yet so it will produce different output. I have no time to update it right now. Sorry for this inconvenience.

Related Question