Полностью сделал задачу 6 на вычислительную геометрию
This commit is contained in:
parent
a08f95aef8
commit
3efd67c703
15 changed files with 570 additions and 60 deletions
|
|
@ -6,6 +6,7 @@ int main(void) {
|
|||
points pts;
|
||||
point N[3];
|
||||
circle crcl;
|
||||
int numLose;
|
||||
|
||||
pts = getPoints();
|
||||
if (pts.array == NULL) return -1;
|
||||
|
|
@ -16,9 +17,15 @@ int main(void) {
|
|||
crcl = MEC(pts.array, pts.length, N, 0);
|
||||
printCircle(crcl);
|
||||
|
||||
if ((numLose = isCover(crcl, pts)) == pts.length) printf("\nThe circle covers all the points!\n");
|
||||
else printf("\nThe circle misses a maximum of %d points", pts.length - numLose);
|
||||
|
||||
printf("\nReliable algorithm:\n");
|
||||
crcl = hope(pts.array, pts.length);
|
||||
printCircle(crcl);
|
||||
|
||||
if (isCover(crcl, pts) == pts.length) printf("\nThe circle covers all the points!\n");
|
||||
else printf("\nThe circle misses a maximum of %d points", pts.length - numLose);
|
||||
|
||||
free(pts.array);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue