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

Function main

contents/graham_scan/code/c/graham.c:97–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97int main() {
98 struct point points[] = {{-5, 2}, {5, 7}, {-6, -12}, {-14, -14}, {9, 9},
99 {-1, -1}, {-10, 11}, {-6, 15}, {-6, -8}, {15, -9},
100 {7, -7}, {-2, -9}, {6, -5}, {0, 14}, {2, 8}};
101 size_t num_initial_points = 15;
102
103 printf("Points:\n");
104 for (size_t i = 0; i < num_initial_points; ++i) {
105 printf("(%f,%f)\n", points[i].x, points[i].y);
106 }
107
108 size_t hull_size = graham_scan(points, num_initial_points);
109
110 printf("\nHull:\n");
111 for (size_t i = 0; i < hull_size; ++i) {
112 printf("(%f,%f)\n", points[i].x, points[i].y);
113 }
114
115 return 0;
116}

Callers

nothing calls this directly

Calls 1

graham_scanFunction · 0.70

Tested by

no test coverage detected