// clang sph.c fac.c gen.c -Wmost -O2 // (define π (* 4 (atan 1))) #include #include #include "blob.h" // #include static R pt[VN]; // remember potential at vertices. static R P(Pt w){R tp = 0; for(int j = 0; jx;} // ugly! static void tst(Pt w){prP("at:", w); printf("pot is %10.7f\n", P(w));} int main(){sph(); if(0) {tst((Pt){0, 0, 0}); tst((Pt){0, 0.5, 0}); tst((Pt){0, sqrt(0.5), 0}); tst((Pt){1, 0, 0}); tst((Pt){0, 0, 1}); tst((Pt){0, 0, 2}); tst((Pt){0, 4, 3}); tst((Pt){5, 0, 0});} if(1) {R tu = 0, td = 1000, ts = 0; for(int j=0; j