\section{Random point definition}
%<--------------------------------------------------------------------------->
%           points random
%<--------------------------------------------------------------------------->
At the moment there are four possibilities:
\begin{enumerate}
  \item point in a rectangle;
  \item on a segment;
  \item on a straight line;
  \item on a circle.
\end{enumerate}

\subsection{Obtaining random points}
This is the new version that replaces  \tkzcname{tkzGetRandPointOn}.
\begin{NewMacroBox}{tkzDefRandPointOn}{\oarg{local options}}%
{The result is a point with a random position that can be named with the macro \tkzcname{tkzGetPoint}. It is possible to use \tkzname{tkzPointResult} if it is not necessary to retain the results.}

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition                         \\ 
\midrule
\TOline{rectangle=pt1 and pt2}  {}{[rectangle=A and B]} 
\TOline{segment= pt1--pt2} {}{[segment=A--B]}
\TOline{line=pt1--pt2}{}{[line=A--B]} 
\TOline{circle =center pt1 radius dim}{}{[circle = center A radius 2]} 
\TOline{circle through=center pt1 through pt2}{}{[circle through= center A through B]}
\TOline{disk through=center pt1 through pt2}{}{[disk through=center A through B]}
\end{tabular}
\end{NewMacroBox} 

\subsubsection{Random point in a rectangle} 

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}
  \tkzDefPoints{0/0/A,5/3/C}
  \tkzDefRandPointOn[rectangle = A and C]
  \tkzGetPoint{E}
  \tkzDefRectangle(A,C)\tkzGetPoints{B}{D}
  \tkzDrawPolygon[red](A,...,D)
  \tkzDrawPoints(A,...,E) 
  \tkzLabelPoints(A,B)
  \tkzDrawPoints[above](C,D,E) 
\end{tikzpicture} 
\end{tkzexample} 

\subsubsection{Random point on a segment or a line}  
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}  
  \tkzDefPoints{0/0/A,5/2/C}  
  \tkzDefRandPointOn[segment = A--C]\tkzGetPoint{B}
  \tkzDrawLine(A,C)
  \tkzDrawPoints(A,C) \tkzDrawPoint[red](B)
  \tkzLabelPoints(A,C) \tkzLabelPoints[red](B) 
\end{tikzpicture}
\end{tkzexample}


\subsubsection{Random point on a circle or a disk}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}
\tkzDefPoints{3/2/A,1/1/B}
\tkzCalcLength(A,B) \tkzGetLength{rAB} 
\tkzDefRandPointOn[circle = center A radius \rAB] 
\tkzGetPoint{C}
\tkzDefRandPointOn[circle through= center A through B]
\tkzGetPoint{D}
\tkzDefRandPointOn[disk through=center A through B]
\tkzGetPoint{E}
\tkzDrawCircle(A,B)
\tkzDrawPoints(A,B)
\tkzLabelPoints(A,B)
\tkzDrawPoints[red](C,D,E)
\tkzLabelPoints[red,right](C,D,E)
\end{tikzpicture}
\end{tkzexample}
   
\endinput