Пример #1
0
        // spheroid
        LP o_inverse(XY xy)
        {
            LP lp;

            lp.lam = lp.phi = 0;

            lp = link.inv(xy);
            if (lp.lam != Libc.HUGE_VAL)
            {
                lp.lam -= lamp;
                double coslam = Math.Cos(lp.lam);
                double sinphi = Math.Sin(lp.phi);
                double cosphi = Math.Cos(lp.phi);
                lp.phi = Proj.aasin(ctx, sphip * sinphi + cphip * cosphi * coslam);
                lp.lam = Proj.aatan2(cosphi * Math.Sin(lp.lam), sphip * cosphi * coslam - cphip * sinphi);
            }

            return(lp);
        }
Пример #2
0
        // spheroid
        LP s_inverse(XY xy)
        {
            LP lp;

            lp.lam = lp.phi = 0;

            if (Math.Abs(xy.y) <= PHI_LIM)
            {
                lp = sinu.inv(xy);
            }
            else
            {
                xy.y += (xy.y >= 0.0?Y_COR:-Y_COR);
                lp    = moll.inv(xy);
            }

            return(lp);
        }