|
本帖最后由 hbghlyj 于 2024-3-2 20:42 编辑 zhuanlan.zhihu.com/p/54877220
2019-01-05,PGF/TikZ 发布了 v3.1(ctan.org/ctan-ann/id/mailman.640.1546781639.5014.ctan-ann@ctan.org)增加了生成动画的库(animations)。
- \documentclass[tikz, margin=3pt, dvisvgm]{standalone}
- \usetikzlibrary{animations}
- \begin{document}
- \begin{tikzpicture}[
- animate/orbit/.style 2 args = {
- myself:shift = {
- along = {
- (0,0) circle [radius=#1]
- } sloped in #2s/10,
- repeats }} ]
- \node :color = {0s = "orange",
- 2s = "red",
- 4s = "orange",
- repeats}
- {Sun};
- \begin{scope}[animate={orbit={2.5cm}{365}}]
- \node {Earth};
- \node [animate={orbit={1cm}{28}}] {Moon};
- \end{scope}
- \useasboundingbox (-3.8,-3.8) (3.8,3.8);
- \end{tikzpicture}
- \end{document}
复制代码 |
|