To find the parameters of a sphere which is mutually orthogonal to each of four others, it is necessary to solve the four equations
The program which calculates the orthogonal sphere can be made slightly more general, for arbitrary angles of intersection
void fifth(ss,r,t) double ss[][7], r, t; { int i, j; double w[4][4], z[4][4], p[4][4]; double a[4], b[4], ri[4], rr, s; for (i=0; i<4; i++) {for (j=0; j<3; j++) z[i][j]=ss[i][j]; z[i][3]=-0.5;} for (i=0; i<4; i++) for (j=0, ri[i]=0; j<3; j++) ri[i]+=z[i][j]*z[i][j]; for (i=0; i<4; i++) a[i]=0.5*(ri[i]-ss[i][3]); if (t!=0.0) for (i=0; i<4; i++) { s=(r>0?sqrt(r):sqrt(-r)); a[i]+=s*t*sqrt(ri[i]); } geomi4(w,z); for (i=0; i<4; i++) for (j=0, b[i]=0.0; j<4; j++) b[i]+=w[i][j]*a[j]; rr=b[0]*b[0]+b[1]*b[1]+b[2]*b[2]-b[3]; ss[4][0]=b[0]; ss[4][1]=b[1]; ss[4][2]=b[2]; ss[4][3]=rr; }