MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / main

Function main

contents/IFS/code/c/IFS.c:31–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31int main() {
32 const size_t point_count = 10000;
33
34 struct point shape_points [3] = {{0.0,0.0}, {0.5,sqrt(0.75)}, {1.0,0.0}};
35 struct point out_points[point_count];
36
37 srand((unsigned int)time(NULL));
38
39 chaos_game(shape_points, 3, out_points, point_count);
40
41 FILE *fp = fopen("sierpinksi.dat", "w+");
42
43 for (size_t i = 0; i < point_count; ++i) {
44 fprintf(fp, "%f\t%f\n", out_points[i].x, out_points[i].y);
45 }
46
47 fclose(fp);
48
49 return 0;
50}

Callers

nothing calls this directly

Calls 1

chaos_gameFunction · 0.70

Tested by

no test coverage detected