I'm trying to draw a two-dimensional Brownian motion started in a circle and now want to label the first exit time of the motion:
\documentclass[parskip]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{calc,intersections,through,backgrounds}
\begin{document}
\newcommand{\Emmett}[5]{% points, advance, rand factor, options, end label, name
\draw[#4] (0,0)
\foreach \x in {1,...,#1} node(#6)
{ -- ++(rand*#2,rand*#3)
}
node[right] {#5};
}
\begin{tikzpicture}
\coordinate [label=left:$x$] (x) at (0,0);
\coordinate [] (y) at (1,1);
\node (D) [name path=D,draw,circle through=(y),label=left:$D$] at (x) {};
\Emmett{300}{0.2}{0.2}{red}{a}{b};
\end{tikzpicture}
\end{document}
I guess it would be pretty easy with "intersection", if I could name the Brownian motion, but I don't really know how to do that. (Sorry, complete beginner in tikz...)
I'd appreciate any help.