ximat[1][1]=cos(theta)*sin(phi);
ximat[2][1]=-sin(theta);
ximat[0][2]=-sin(theta);
ximat[1][2]=cos(theta);
ximat[2][2]=0.0;
p=pow2.minimize(p,ximat);
f=pow2.fret;
d=sqrt(SQR(p[0])+SQR(p[1])+SQR(p[2]));
// System.out.printf(abs(d-d0) << " " << abs(f-f0));
localflag = localflag || abs(d-d0) > sbeps1;