// gcc n.c -Wmost p.o -fnested-functions ../../../code/invert.o #include "h.h" typedef struct {R p1; R p2; R per;} Suv; typedef struct {pt pos[N];} sv; Suv S[] = { // {0.347111, 0.532728, 6.324449}, { 0.347116767811511, 0.532725000747374, 6.325913462237277}, //{0.306893, 0.125507, 6.235641}, { 0.306893421600765, 0.125506565818490, 6.234674843059651}, //{0.392955, 0.097579, 7.003907}, { 0.392955496410768, 0.097578967671380, 7.003709632880691}, {0.184279, 0.587188, 63.534541}, {0.080584, 0.588836, 21.270975}, {0.083300, 0.127889, 10.466818}, {0.464445, 0.396060, 14.893911}, {0.439166, 0.452968, 28.6700278}, {0.383444, 0.377364, 25.840618}, {0.405916, 0.230163, 13.865763}, //{0.350112, 0.079339, 79.475875}, { 0.351587929760850, 0.078670498782693, 79.533325949045079}, {0.559064, 0.349192, 55.501762}, {0.513938, 0.304736, 17.328370}, {0.282699, 0.327209, 10.962563}, {0.416822, 0.330333, 55.789829}, {0.417343, 0.313100, 54.207599} }; void pSuv(Suv p){printf("{%18.15f, %18.15f, %19.15f}\n", (d)p.p1, (d)p.p2, (d)p.per);} void p3(char * m, d e[3]){int y; for(y=0; y<3; ++y) printf("%15e ", e[y]); printf(" %s\n", m);} int solve(int n, double A[n][n], double B[n]); int main(){ // printf("%d\n", (int)sizeof(R)); assert(N==3); d ce(sv t, sv u){R e = 0; {int n=N; while(n--){int dd=D; while(dd--) e += s(t.pos[n].dv[dd].x - u.pos[n].dv[dd].x ) +s(t.pos[n].dv[dd].xd - u.pos[n].dv[dd].xd);}} return sqrt(e);} assert(N==3); {int j; for(j=0; j