10 void cfnewp(
const long int ich,
double *parold,
double *
ref,
double *
s,
double *parnew,
double *per)
13 double dphi, coth, hper, zper, zeps, r__, cs, xc, yc, sn, sipart, eps;
39 coth = 1. /
tan(parold[3]);
44 hper = eps -
ref[1] * sn +
ref[2] * cs;
46 (*s) =
ref[1] * cs +
ref[2] * sn;
47 zper = zeps + coth * (*s) -
ref[3];
51 if (r__ < 0.) sipart = -1.;
53 xc = (eps - r__) * sn -
ref[1];
54 yc = -(eps - r__) * cs-
ref[2];
55 hper = r__ - sipart * sqrt(xc*xc + yc*yc);
57 double tmp_prec= - eps - cs*
ref[2] + sn*
ref[1];
58 dphi = atan2(sipart * (
ref[1]*cs +
ref[2]*sn),
59 sipart * (r__ + tmp_prec) );
62 zper = zeps + coth * (*s) -
ref[3];
66 parnew[3] = parold[3];
67 parnew[4] = parold[4] + dphi;
70 while (parnew[4] > 6.2831853071794) parnew[4] -= 6.2831853071794;
71 while (parnew[4] <-6.2831853071794) parnew[4] += 6.2831853071794;
75 parnew[5] = parold[5];
76 per[1] =
ref[1] +
sin(parold[4] + dphi) * hper;
77 per[2] =
ref[2] -
cos(parold[4] + dphi) * hper;
78 per[3] =
ref[3] + zper;