Consider a path made up of equal-length segments that can point at any
angle of the form radians, for , like spokes on
a wheel. A path is specified by a finite sequence of integers, taken
modulo . For example, if , then the sequence
corresponds to the ASCII path _/\_
. ePiX's fractal
approximation starts with such a ``seed'' then recursively (up to a
specified depth) replaces each segment with a scaled and rotated copy
of the seed. The seed above generates the standard von Koch snowflake
fractal. In code:
const int seed[] = {6, 4, 0, 1, -1, 0}; fractal(P(a,b), P(c,d), depth, seed);The first entry of seed[] (here 6) is the number of ``spokes'' , the second (4) is the number of terms in the seed, and the remaining entries are the seed proper. The final path joins to . The number of segments in the final path grows exponentially in the depth, so depths larger than 5 or 6 are likely to exceed the capabilities of LATEX and/or PostScript.