inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const { COMPLEX p; double *C; int i; lp_lat = (lp_lat - this->m_par.phi0) * RAD_TO_SEC5; for (p.r = *(C = tpsi + (i = Ntpsi)); i ; --i) p.r = *--C + lp_lat * p.r; p.r *= lp_lat; p.i = lp_lon; p = pj_zpoly1(p, bf, Nbf); xy_x = p.i; xy_y = p.r; }
FORWARD(e_forward); /* ellipsoid */ double sinlon, coslon, esphi, chi, schi, cchi, s; COMPLEX p; sinlon = sin(lp.lam); coslon = cos(lp.lam); esphi = P->e * sin(lp.phi); chi = 2. * atan(tan((HALFPI + lp.phi) * .5) * pow((1. - esphi) / (1. + esphi), P->e * .5)) - HALFPI; schi = sin(chi); cchi = cos(chi); s = 2. / (1. + P->schio * schi + P->cchio * cchi * coslon); p.r = s * cchi * sinlon; p.i = s * (P->cchio * schi - P->schio * cchi * coslon); p = pj_zpoly1(p, P->zcoeff, P->n); xy.x = p.r; xy.y = p.i; return xy; } INVERSE(e_inverse); /* ellipsoid */ int nn; COMPLEX p, fxy, fpxy, dp; double den, rh, z, sinz, cosz, chi, phi, dphi, esphi; p.r = xy.x; p.i = xy.y; for (nn = 20; nn ;--nn) { fxy = pj_zpolyd1(p, P->zcoeff, P->n, &fpxy); fxy.r -= xy.x; fxy.i -= xy.y;