Написал 6е задание на вычислительную геометрию, задача наименьшего круга по алгоритму Велзля
This commit is contained in:
parent
6e9934a2d8
commit
b36187b77d
18 changed files with 264 additions and 1 deletions
23
ComputationalGeometry/6Ex/main.c
Normal file
23
ComputationalGeometry/6Ex/main.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "tools.h"
|
||||
#include "SCP.h"
|
||||
|
||||
int main(void) {
|
||||
points ps;
|
||||
point N[3];
|
||||
circle crcl;
|
||||
FILE * file = getFile();
|
||||
if (file == NULL) return -1;
|
||||
|
||||
ps = getPoints(file);
|
||||
if (ps.array == NULL) return -2;
|
||||
|
||||
for (int i = 0; i < ps.length; ++i) printf("(%.2lf, %.2lf) ", ps.array[i].x, ps.array[i].y);
|
||||
printf("\n");
|
||||
|
||||
crcl = MEC(ps.array, ps.length, N, 0);
|
||||
printCircle(crcl);
|
||||
|
||||
free(ps.array);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue