我现在正在看教授的幻灯片:
http://www.math.ucla.edu/~virtanen/40a.1.14s/schedule/lec1.pdf
第一张幻灯片总是有这些复杂的波浪线。如果你在 Google 上搜索“波浪线”,你会得到类似的结果,例如:
http://www.featurepics.com/online/Vector-Wave-Lines-Abstract-Background-588098.aspx
我想知道,是否有一个包允许您在文档中创建这些?如果没有,我怎样才能让一个对角线穿过页面,从文档的最左侧到最右侧,像波浪一样狂野。
答案1
可能不完全是所需的,但它给出了可以做什么的想法:
\documentclass[tikz]{standalone}
\usetikzlibrary{backgrounds,calc}
\begin{document}
\begin{tikzpicture}[x=1pt,y=1pt, line cap=round,
show background rectangle,inner frame sep=1cm,
background rectangle/.style={top color=blue!75, bottom color=white}]
\foreach \i in {0,5,...,720}
\draw [white, ultra thin, opacity=\i/720]
(-\i+\i*3, -0.5*\i*sin \i*1.25) coordinate (A\i) --
(\i+\i*2.5, -0.75*\i*cos \i) coordinate (B\i);
\foreach \i [evaluate={\j=int(\i+5);}] in {0,5,...,715}
\foreach \k in {0,0.05,...,1.05}
\draw [white, ultra thin, opacity=\i/720]
($(A\i)!\k!(B\i)$) -- ($(A\j)!\k!(B\j)$);
\end{tikzpicture}
\end{document}
以下示例的原理与上述相同,但编码更紧凑/高效。需要反复试验才能得到正确的数字,但结果可能相当令人满意:
\documentclass[tikz]{standalone}
\usetikzlibrary{backgrounds,calc}
\begin{document}
\begin{tikzpicture}[x=1pt,y=1pt, line cap=round,
show background rectangle,inner frame sep=1cm,
background rectangle/.style={top color=blue!75, bottom color=white},
declare function={
xa(\i)=\i/3; ya(\i)=20*sin(\i/2)+20*sin(\i*2);
xb(\i)=\i/2.5; yb(\i)=10*sin(\i/2)+10*sin(\i*2);
}]
\foreach \i [evaluate={\j=max(\i-5,-720); \a=abs(\i); \o=(\a>630) ? (720-\a)/90 : 1;}]
in {-720,-715,...,720}
\draw [white, thin, opacity=\o, rotate=\i/30] (xa \i, ya \i) coordinate (A\i)
(xb \i, yb \i) coordinate (B\i)
\foreach \k in {0,0.1,...,1.01}{
($(A\i)!\k!(B\i)$) -- ($(A\j)!\k!(B\j)$)
};
\end{tikzpicture}
\end{document}