Написал надёжный алгоритм поиска наименьшего круга
This commit is contained in:
parent
b36187b77d
commit
b24722eefc
5 changed files with 90 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "tools.h"
|
||||
#include "SCP.h"
|
||||
#include "hope.h"
|
||||
|
||||
int main(void) {
|
||||
points ps;
|
||||
|
|
@ -11,11 +12,19 @@ int main(void) {
|
|||
ps = getPoints(file);
|
||||
if (ps.array == NULL) return -2;
|
||||
|
||||
printf("\nPoints:\n");
|
||||
for (int i = 0; i < ps.length; ++i) printf("(%.2lf, %.2lf) ", ps.array[i].x, ps.array[i].y);
|
||||
printf("\n");
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
printf("Fast algorithm:\n");
|
||||
crcl = MEC(ps.array, ps.length, N, 0);
|
||||
printCircle(crcl);
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Reliable algorithm:\n");
|
||||
crcl = hope(ps.array, ps.length);
|
||||
printCircle(crcl);
|
||||
|
||||
free(ps.array);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue