示例#1
0
        public override PJ Init()
        {
            no_cut = Proj.pj_param_b(ctx, parameters, "no_cut");
            double beta = 0.5 * (Proj.HALFPI - Proj.pj_param_r(ctx, parameters, "lat_b"));

            if (Math.Abs(beta) < EPS)
            {
                Cb = -0.5;
            }
            else
            {
                Cb  = 1.0 / Math.Tan(beta);
                Cb *= Cb * Math.Log(Math.Cos(beta));
            }

            if (Math.Abs(Math.Abs(phi0) - Proj.HALFPI) < EPS)
            {
                if (phi0 < 0.0)
                {
                    p_halfpi = -Proj.HALFPI;
                    mode     = airy_mode.S_POLE;
                }
                else
                {
                    p_halfpi = Proj.HALFPI;
                    mode     = airy_mode.N_POLE;
                }
            }
            else
            {
                if (Math.Abs(phi0) < EPS)
                {
                    mode = airy_mode.EQUIT;
                }
                else
                {
                    mode   = airy_mode.OBLIQ;
                    sinph0 = Math.Sin(phi0);
                    cosph0 = Math.Cos(phi0);
                }
            }
            fwd = s_forward_airy;
            es  = 0.0;

            return(this);
        }
示例#2
0
        public override PJ Init()
        {
            no_cut=Proj.pj_param_b(ctx, parameters, "no_cut");
            double beta=0.5*(Proj.HALFPI-Proj.pj_param_r(ctx, parameters, "lat_b"));
            if(Math.Abs(beta)<EPS) Cb=-0.5;
            else
            {
                Cb=1.0/Math.Tan(beta);
                Cb*=Cb*Math.Log(Math.Cos(beta));
            }

            if(Math.Abs(Math.Abs(phi0)-Proj.HALFPI)<EPS)
            {
                if(phi0<0.0)
                {
                    p_halfpi=-Proj.HALFPI;
                    mode=airy_mode.S_POLE;
                }
                else
                {
                    p_halfpi=Proj.HALFPI;
                    mode=airy_mode.N_POLE;
                }
            }
            else
            {
                if(Math.Abs(phi0)<EPS) mode=airy_mode.EQUIT;
                else
                {
                    mode=airy_mode.OBLIQ;
                    sinph0=Math.Sin(phi0);
                    cosph0=Math.Cos(phi0);
                }
            }
            fwd=s_forward_airy;
            es=0.0;

            return this;
        }