\newcommand{\randpoints}[3] {
% #1 is the center coordinates
% #2 is number of points
% #3 is variation
\foreach \x in {1,2,...,#2}{
%\filldraw[black] #1++(${rand*#3}*(1,0)+{rand*#3}*(0,1)$) circle (.05pt);
\draw #1++(${rand*#3}*(1,0)+{rand*#3}*(0,1)$) node[circle, fill,inner sep=0.6pt] {};
}
}

\newcommand{\randpointsx}[3] {
% #1 is the center coordinates
% #2 is number of points
% #3 is variation
\foreach \x in {1,2,...,#2}{
%\filldraw[black] #1++(${rand*#3}*(1,0)+{rand*#3}*(0,1)$) circle (.05pt);
\draw #1++(${rand*#3}*(1,0)+(0,0)$) node[circle, fill,inner sep=0.6pt] {};
}
}


\newcommand{\decorateline}[6] {
% #1 and #2 are coordinates of start and end decorate line
% #3 is the amplitude
% #4 is the length of decoration
% #5 is the dot spacing
% #6 is the text of line
\draw[line width=1pt,decorate, decoration={snake, segment length=#4, amplitude=#3}, dots, line width=1.5pt,line cap=round, dash pattern=on 0pt off #5\pgflinewidth] #1 -- #2 node [midway,above,align=center,font=\footnotesize]{#6};
}