[Tex/LaTex] Drawing a constant randomly distorted circle

randomrandom numberstikz-pgf

I am trying to draw a special and contradictive plot : A circle with random distortions which have to remain constant regardless of how many times I build the document.

An example of what I am trying to achieve can be seen below

enter image description here

This figure was produced with the following code

\documentclass{standalone}
\usepackage{tikz}   
\usetikzlibrary{decorations.pathmorphing}


\begin{document}
    \begin{tikzpicture}
        % axes
        \draw[ultra thin] (-2.5, 0) -- (2.5, 0);
        \draw[ultra thin] (0, -2.5) -- (0, 2.5);
        % undistorted sphere
        \draw[ultra thin, dashed] (0, 0) circle (2.25cm);
        \draw[ultra thin, dashed, ->] (0:0) -- (125:2.25);
        \node at (-1, 1) {$R$};
        % distrorted sphere
        \draw[very thick] plot[domain=0:350,smooth cycle ] (\x:2+rnd*0.5);
        \draw[very thick, ->] (0:0) -- (45:2.1);
        \draw[ultra thin, ->] (1, 0) arc (0:45:1);
        \node at (1.2, 0.4) {$\theta$};
        \node at (0.7, 1.25) {$R(\theta)$};
    \end{tikzpicture}
\end{document}

The problem with the code is that whenever I make a change to it and rebuild the document, the "distorted" circle will have a different shape, since I am using the rnd function. The reason I would like to have a constant-random shape is because I would like to denote its radius at an angle θ, therefore it has to touch the outline of the circle.

Any idea on how to achieve such a thing?

Best Answer

In answer by user JPG, the vector R don't intersect with randomize curve. For achieving the intersecting of two path, we have to use the intersections library. Adding to JPG's answer:

\documentclass{standalone}
\usepackage{tikz}   
\usetikzlibrary{decorations.pathmorphing,intersections}

    \begin{document}
       \begin{tikzpicture}[>=latex]
            \pgfmathsetseed{1} % choose a number which give a good shape to your circle
            % axes
            \draw[ultra thin] (-2.5, 0) -- (2.5, 0);
            \draw[ultra thin] (0, -2.5) -- (0, 2.5);
            % undistorted sphere
            \draw[ultra thin, dashed] (0, 0) circle (2.25cm);
            \draw[ultra thin, dashed, ->] (0:0) -- (125:2.25);
            \node at (-1, 1) {$R$};
            % distrorted sphere
            \path[draw,very thick, name path=curve] plot[domain=0:350,smooth cycle ] (\x:2+rnd*0.5);
            \path[very thick, name path=line] (0:0) -- (45:2.5);
            \draw [name intersections={of=curve and  line, by=x}];
            \draw [very thick, ->] (0,0)--(x);
            \draw[ultra thin, ->] (1, 0) arc (0:45:1);
            \node at (1.2, 0.4) {$\theta$};
            \node at (0.7, 1.25) {$R(\theta)$};
        \end{tikzpicture}
    \end{document}

enter image description here