Tikz:在球体上的两个固定点之间绘制布朗运动

Tikz:在球体上的两个固定点之间绘制布朗运动

你好,我遇到了以下问题。我有图片: 在此处输入图片描述

由代码生成:

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw [black, |<->|] (0,0) -- (0,2.5);
\node [left] at (0,1.25) {$\frac{R_{\ell -1}}{\sqrt{2}}$};
\draw [black, |<->|] (0,0) -- (0,-1.25);
\node [left] at (0,-0.625) {$\frac{R_{\ell -1}}{2\sqrt{2}}$};
\draw [gray] (3,0) circle [radius = 2.5];
\draw [gray] (3,0) circle [radius = 1.25];
\draw [gray, fill] (3,0) circle [radius = 0.01];

\draw [black, fill] (2.5,-0.95) circle [radius = 0.03];
\draw [gray, thin] (2.47,-1) -- (2.1, -1.5);
\node [below] at (2.5,-1.35) {$\varrho_{\ell -1} (X_{\eta_j^{\ell -1}})$};

\draw [black, fill] (1.25,1.625) circle [radius = 0.03] node [right]  {$\varrho_{\ell -1} ( X_{\zeta_j^{\ell -1} , m(\eta_j^{\ell -1})} )$};
\end{tikzpicture}
\end{document}

我想要的是:

在此处输入图片描述

我在 GIMP 中画出了这条美丽的布朗路径。我是 tikz 新手,完全不知道如何生成适合我问题的点。

答案1

您似乎对随机路径有一些限制。因此,我建议绘制您心中的路径并用 来装饰它random steps。您可以根据需要调整segment length和。amplitude

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\draw [black, |<->|] (0,0) -- (0,2.5);
\node [left] at (0,1.25) {$\frac{R_{\ell -1}}{\sqrt{2}}$};
\draw [black, |<->|] (0,0) -- (0,-1.25);
\node [left] at (0,-0.625) {$\frac{R_{\ell -1}}{2\sqrt{2}}$};
\draw [gray] (3,0) circle [radius = 2.5];
\draw [gray] (3,0) circle [radius = 1.25];
\draw [gray, fill] (3,0) circle [radius = 0.01];

\draw [black, fill] (2.5,-0.95) circle [radius = 0.03];
\draw [gray, thin] (2.47,-1) -- (2.1, -1.5);
\node [below] at (2.5,-1.35) {$\varrho_{\ell -1} (X_{\eta_j^{\ell -1}})$};

\draw [black, fill] (1.25,1.625) circle [radius = 0.03] node [right]  {$\varrho_{\ell -1} ( X_{\zeta_j^{\ell -1} , m(\eta_j^{\ell -1})} )$};
\draw[decorate,decoration={random steps,segment length=1pt,amplitude=2pt}] (2.5,-0.95) to[out=45,in=0] ++ (-0.1,0.4) 
to[out=180,in=-90] ++(-0.6,0.3) 
to[out=90,in=-90] ++(0.8,0.5)
to[out=90,in=-90] ++(-0.6,0.1) 
to[out=90,in=-90] (1.25,1.625) ;
\end{tikzpicture}
\end{document}

在此处输入图片描述

编辑:解决线段长度较短的问题的技巧dimension too large。不用说,您不能用这种方法将线段长度任意缩短。

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\newsavebox\mypic
\sbox\mypic{
\begin{tikzpicture}[scale=4,transform shape]
\draw [black, |<->|] (0,0) -- (0,2.5);
\node [left] at (0,1.25) {$\frac{R_{\ell -1}}{\sqrt{2}}$};
\draw [black, |<->|] (0,0) -- (0,-1.25);
\node [left] at (0,-0.625) {$\frac{R_{\ell -1}}{2\sqrt{2}}$};
\draw [gray] (3,0) circle [radius = 2.5];
\draw [gray] (3,0) circle [radius = 1.25];
\draw [gray, fill] (3,0) circle [radius = 0.01];

\draw [black, fill] (2.5,-0.95) circle [radius = 0.03];
\draw [gray, thin] (2.47,-1) -- (2.1, -1.5);
\node [below] at (2.5,-1.35) {$\varrho_{\ell -1} (X_{\eta_j^{\ell -1}})$};

\draw [black, fill] (1.25,1.625) circle [radius = 0.03] node [right]  {$\varrho_{\ell -1} ( X_{\zeta_j^{\ell -1} , m(\eta_j^{\ell -1})} )$};
\draw[decorate,decoration={random steps,segment length=0.5pt,amplitude=2pt}] (2.5,-0.95) to[out=45,in=0] ++ (-0.1,0.4) 
to[out=180,in=-90] ++(-0.6,0.3) 
to[out=90,in=-90] ++(0.8,0.5)
to[out=90,in=-90] ++(-0.6,0.1) 
to[out=90,in=-90] (1.25,1.625) ;
\end{tikzpicture}}
\begin{document}
\begin{tikzpicture}
\node[scale=0.25]{\usebox{\mypic}};
\end{tikzpicture}
\end{document}

在此处输入图片描述

另一项编辑:忍不住申请马克·维布罗的惊人绝技segment length这里:嵌套装饰。也就是说,您可以将较小的阶梯装饰放在较大的和/或装饰之上amplitude,甚至可以重复此操作。尽管我已验证它可以工作,但对我来说仍然很难做到。

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\newsavebox\mypic
\sbox\mypic{
\begin{tikzpicture}[scale=4,transform shape]
\draw [black, |<->|] (0,0) -- (0,2.5);
\node [left] at (0,1.25) {$\frac{R_{\ell -1}}{\sqrt{2}}$};
\draw [black, |<->|] (0,0) -- (0,-1.25);
\node [left] at (0,-0.625) {$\frac{R_{\ell -1}}{2\sqrt{2}}$};
\draw [gray] (3,0) circle [radius = 2.5];
\draw [gray] (3,0) circle [radius = 1.25];
\draw [gray, fill] (3,0) circle [radius = 0.01];

\draw [black, fill] (2.5,-0.95) circle [radius = 0.03];
\draw [gray, thin] (2.47,-1) -- (2.1, -1.5);
\node [below] at (2.5,-1.35) {$\varrho_{\ell -1} (X_{\eta_j^{\ell -1}})$};

\draw [black, fill] (1.25,1.625) circle [radius = 0.03] node [right]  {$\varrho_{\ell -1} ( X_{\zeta_j^{\ell -1} , m(\eta_j^{\ell -1})} )$};
\draw
  {decorate[decoration={random steps, segment length=0.5,amplitude=0.5}]
  {decorate[decoration={random steps, segment length=1,amplitude=1}]
  {decorate[decoration={random steps, segment length=8,amplitude=8}]     
  { (2.5,-0.95) to[out=45,in=0] ++ (-0.1,0.4) 
to[out=180,in=-90] ++(-0.6,0.3) 
to[out=90,in=-90] ++(0.8,0.5)
to[out=90,in=-90] ++(-0.6,0.1) 
to[out=90,in=-90] (1.25,1.625) }}}};

\end{tikzpicture}}
\begin{document}
\begin{tikzpicture}
\node[scale=0.25]{\usebox{\mypic}};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容