Ejemplo n.º 1
0
        protected PJ_nsper setup()
        {
            height = Proj.pj_param_d(ctx, parameters, "h");
            if (height <= 0.0)
            {
                Proj.pj_ctx_set_errno(ctx, -30); return(null);
            }
            if (Math.Abs(Math.Abs(phi0) - Proj.HALFPI) < EPS10)
            {
                mode = phi0 < 0.0?nsper_mode.S_POLE:nsper_mode.N_POLE;
            }
            else if (Math.Abs(phi0) < EPS10)
            {
                mode = nsper_mode.EQUIT;
            }
            else
            {
                mode   = nsper_mode.OBLIQ;
                sinph0 = Math.Sin(phi0);
                cosph0 = Math.Cos(phi0);
            }
            pn1   = height / a;       // normalize by radius
            p     = 1.0 + pn1;
            rp    = 1.0 / p;
            h     = 1.0 / pn1;
            pfact = (p + 1.0) * h;
            inv   = s_inverse;
            fwd   = s_forward;
            es    = 0.0;

            return(this);
        }
Ejemplo n.º 2
0
        protected PJ_nsper setup()
        {
            height=Proj.pj_param_d(ctx, parameters, "h");
            if(height<=0.0) { Proj.pj_ctx_set_errno(ctx, -30); return null; }
            if(Math.Abs(Math.Abs(phi0)-Proj.HALFPI)<EPS10) mode=phi0<0.0?nsper_mode.S_POLE:nsper_mode.N_POLE;
            else if(Math.Abs(phi0)<EPS10) mode=nsper_mode.EQUIT;
            else
            {
                mode=nsper_mode.OBLIQ;
                sinph0=Math.Sin(phi0);
                cosph0=Math.Cos(phi0);
            }
            pn1=height/a; // normalize by radius
            p=1.0+pn1;
            rp=1.0/p;
            h=1.0/pn1;
            pfact=(p+1.0)*h;
            inv=s_inverse;
            fwd=s_forward;
            es=0.0;

            return this;
        }