1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/* -*-ePiX-*- */
/* koch.c -- Simple fractal "curve" generation. -- June 6, 2002 */
#include "epix.h"
using namespace ePiX;
// const int koch_seed[] = {6, 4, 0, 1, -1, 0};
const int seed[] = {4, 8, 0, 1, 0, 3, 3, 0, 1, 0};
int main()
{
bounding_box(P(0,0), P(3, 0.5));
picture(P(3, 0.5));
unitlength("1in");
offset(P(0,0.25));
begin();
for (int i=1; i <= 3; ++i)
fractal(P(i-1,0), P(i,0), i, seed);
end();
}
|