Добавил выбор между рандомной генерацией и файлом в 6м задании
This commit is contained in:
parent
7e7ec0e12c
commit
610ed3990a
4 changed files with 95 additions and 19 deletions
|
@ -3,30 +3,30 @@
|
|||
#include "hope.h"
|
||||
|
||||
int main(void) {
|
||||
points ps;
|
||||
points * pts;
|
||||
point N[3];
|
||||
circle crcl;
|
||||
FILE * file = getFile();
|
||||
if (file == NULL) return -1;
|
||||
|
||||
ps = getPoints(file);
|
||||
if (ps.array == NULL) return -2;
|
||||
pts = getPoints(file);
|
||||
if (pts == NULL) return -1;
|
||||
|
||||
/*
|
||||
printf("\nPoints:\n");
|
||||
for (int i = 0; i < ps.length; ++i) printf("(%.2lf, %.2lf) ", ps.array[i].x, ps.array[i].y);
|
||||
printf("\n\n");
|
||||
|
||||
printf("Fast algorithm:\n");
|
||||
crcl = MEC(ps.array, ps.length, N, 0);
|
||||
*/
|
||||
|
||||
printPoints(*pts);
|
||||
|
||||
printf("\nFast algorithm:\n");
|
||||
crcl = MEC(ps->array, ps->length, N, 0);
|
||||
printCircle(crcl);
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Reliable algorithm:\n");
|
||||
crcl = hope(ps.array, ps.length);
|
||||
printf("\nReliable algorithm:\n");
|
||||
crcl = hope(ps->array, ps->length);
|
||||
printCircle(crcl);
|
||||
|
||||
free(ps.array);
|
||||
free(ps->array);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue