/* eomsf - intersection of a family of spheres */ void eomsf(s,n) double s[][7]; int n; { int i, j, k, m, mi; double b1, b2, g, th, dh, ri; double emi, p[3], o[3][3]; g=57.0; for (i=0; i<n; i++) { ri=s[i][3]; emi=2000.0*ri; mi=(int)emi; dh=3.14159/emi; th=0.0; spheu(o,&s[i][4]); for (k=0; k<mi; k++) { th+=dh; sphrv(p,ri,th,g*th); sphap(p,o,p,&s[i][0]); if (p[1]>s[i][1]) continue; m=1; for (j=0; j<n; j++) { if (i==j) continue; sphdj(&b1,&b2,p,s,j); if (b1<0.0) {m=0; break;} if (p[1]<=s[j][1]) continue; if (b2<=0.0) {m=0; break;} } /* end for j */ pltms(p[0],p[2],m); } /* end for k */ } /* end for i */ }