答案1
我的解决方案目前仅适用于中心点。我用轴向阴影填充一个矩形(末端有一个圆圈)。为了旋转阴影,我使用画布变换。这会弄乱边界框,这是\path (-8,-8) rectangle (8,8);
\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\path (-8,-8) rectangle (8,8);
\newcommand{\golden}{180*(3-sqrt(5))};
\foreach \i in {50,...,1}{
\fill[left color=blue, right color=red!80!black, middle color=yellow, transform canvas={rotate= \golden*\i}] (0,0.05) rectangle ({sqrt(\i)}, -0.05) ({sqrt(\i)},0) circle[radius=0.3];
}
\end{tikzpicture}
\end{document}
答案2
如果您接受 Metapost 的答案,这可能是一个起点。否则,我希望另一个用户将示例翻译成 TikZ 或其他任何语言。您需要--shell-escape
启用并安装 Metapost(mpost
在终端或命令提示符中检查)。
\documentclass{article}
%Use --shell-escape or -enable-write18
\usepackage[shellescape,latex]{gmp}
\begin{document}
\begin{mpost}[name=nice]
%Define yellow just in case. ConTeXt does.
color yellow; yellow := (1, 1, 0);
numeric n, u; n := 100; u := 4mm;
%Helmut Vogel's formulas for sunflowers are a lazy, nice way to fill circles
numeric GoldenAngle; GoldenAngle := 180*(3-sqrt(5));
%Play changing "3u" to move the center.
pair Center, Points[]; Center := (left+up)*3u;
for i = 1 upto n:
Points[i] := ((sqrt(i)*sind(GoldenAngle*i)), (sqrt(i)*cosd(GoldenAngle*i)))*u;
draw Center -- (.25[Center,Points[i]]) withcolor blue;
draw (.25[Center,Points[i]]) -- (.5[Center,Points[i]]) withcolor green;
draw (.5[Center,Points[i]]) -- (.75[Center,Points[i]]) withcolor yellow;
draw (.75[Center,Points[i]]) -- Points[i] withcolor red;
endfor
for i = 1 upto n:
%Change "scaled ..." for larger or smaller dots.
drawdot Points[i] withpen pencircle scaled 5 withcolor .5[red,black];
endfor
\end{mpost}
\begin{center}
\usempost{nice}
\end{center}
\end{document}