Creating an animation
To show a developing process or visualize changes, an in-place animation can be more convenient than a series of images.
As an example application, we will draw a recursively defined fractal curve, the Koch curve. An animation shall present the stages of the curve, which becomes more complex with more recursions.
How to do it...
The animate package provides a simple way to generate an animation. Let’s try this with the Koch curve to show growing complexity by performing the following steps:
- Start with any document class. Here, we’ve chosen the standalone class, which we already mentioned earlier. So, the animation tightly fits on the page:
\documentclass[border=10pt]{standalone}
- Load the animate package:
\usepackage{animate}
- Load the TikZ package. Furthermore, load the lindenmayersystems library to produce fractals and the shadings library for filling with a shading:
\usepackage{tikz} \usetikzlibrary{lindenmayersystems,shadings...