答案1
第一个是与随机路径角度有关的好方法元帖子。这包含在中luamplib
,因此要在 Overleaf 中编译它,您需要lualatex
在菜单中选择该选项。
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
path xx, tt;
xx = (left -- 5 right) scaled 64;
tt = xx rotated 90;
drawarrow xx; label.rt("$x$", point 1 of xx);
drawarrow tt; label.top("$t$", point 1 of tt);
z0 = (42, 18);
z1 = (264, 300);
vardef random_path(expr a, b, r) =
a {dir (r + uniformdeviate (180 - 2r))} ..
b {dir (r + uniformdeviate (180 - 2r))} enddef;
for i=1 upto 10:
draw random_path(z0, z1, 18) withpen pencircle scaled 1/2 withcolor 2/3 blue;
endfor
dotlabel.bot("$(x', t')$", z0);
dotlabel.top("$(x'', t'')$", z1);
endfig;
\end{mplibcode}
\end{document}