当前位置: 首页>>代码示例>>C#>>正文


C# XY类代码示例

本文整理汇总了C#中XY的典型用法代码示例。如果您正苦于以下问题:C# XY类的具体用法?C# XY怎么用?C# XY使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XY类属于命名空间,在下文中一共展示了XY类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: s_inverse

        // spheroid
        LP s_inverse(XY xy)
        {
            LP lp;
            lp.lam=lp.phi=0;

            if(n!=0)
            {
                lp.phi=xy.y;
                int i=MAX_ITER;
                for(; i>0; i--)
                {
                    double v=(n*lp.phi+n1*Math.Sin(lp.phi)-xy.y)/(n+n1*Math.Cos(lp.phi));
                    lp.phi-=v;
                    if(Math.Abs(v)<LOOP_TOL) break;
                }

                if(i==0) lp.phi=xy.y<0.0?-Proj.HALFPI:Proj.HALFPI;
            }
            else lp.phi=Proj.aasin(ctx, xy.y);

            double V=Math.Cos(lp.phi);
            lp.lam=xy.x*(n+n1*V)/V;

            return lp;
        }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:26,代码来源:pj_fouc_s.cs

示例2: s_inverse

        // spheroid
        LP s_inverse(XY xy)
        {
            LP lp;
            lp.lam=lp.phi=0;

            lp.phi=xy.y/FYC;
            if(Math.Abs(lp.phi)>=1.0)
            {
                if(Math.Abs(lp.phi)>ONEEPS) { Proj.pj_ctx_set_errno(ctx, -20); return lp; }
                else lp.phi=(lp.phi<0.0)?-Proj.HALFPI:Proj.HALFPI;
            }
            else lp.phi=Math.Asin(lp.phi);

            lp.phi*=3.0;
            lp.lam=xy.x/(FXC*(2.0*Math.Cos(C23*lp.phi)-1.0));
            lp.phi=Math.Sin(lp.phi)/CS;
            if(Math.Abs(lp.phi)>=1.0)
            {
                if(Math.Abs(lp.phi)>ONEEPS) { Proj.pj_ctx_set_errno(ctx, -20); return lp; }
                else lp.phi=(lp.phi<0.0)?-Proj.HALFPI:Proj.HALFPI;
            }
            else lp.phi=Math.Asin(lp.phi);

            return lp;
        }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:26,代码来源:pj_mbtfpp.cs

示例3: e_inverse

        // ellipsoid & spheroid
        LP e_inverse(XY xy)
        {
            LP lp;
            lp.lam=lp.phi=0;

            double phipp=2.0*(Math.Atan(Math.Exp(xy.y/kR))-Proj.FORTPI);
            double lampp=xy.x/kR;
            double cp=Math.Cos(phipp);
            double phip=Proj.aasin(ctx, cosp0*Math.Sin(phipp)+sinp0*cp*Math.Cos(lampp));
            double lamp=Proj.aasin(ctx, cp*Math.Sin(lampp)/Math.Cos(phip));
            double con=(K-Math.Log(Math.Tan(Proj.FORTPI+0.5*phip)))/c;

            int i=NITER;
            for(; i>0; i--)
            {
                double esp=e*Math.Sin(phip);
                double delp=(con+Math.Log(Math.Tan(Proj.FORTPI+0.5*phip))-hlf_e*Math.Log((1.0+esp)/(1.0-esp)))*(1.0-esp*esp)*Math.Cos(phip)*rone_es;
                phip-=delp;
                if(Math.Abs(delp)<EPS) break;
            }

            if(i==0) { Proj.pj_ctx_set_errno(ctx, -20); return lp; }
            lp.phi=phip;
            lp.lam=lamp/c;

            return lp;
        }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:28,代码来源:pj_somerc.cs

示例4: GetScreenCorner

    public Vector2 GetScreenCorner(XY screenCoord)
    {
        XYZ screenSize = GameData.World.Config.ScreenSize;

        return new Vector2((float)screenCoord.X * screenSize.X,
                           (float)screenCoord.Y * screenSize.Z);
    }
开发者ID:jtuttle,项目名称:voxels,代码行数:7,代码来源:WorldScreenManager.cs

示例5: s_inverse

        // spheroid
        LP s_inverse(XY xy)
        {
            LP lp;
            lp.lam=lp.phi=0;

            double t;

            lp.phi=RYC*xy.y;
            if(Math.Abs(lp.phi)>1.0)
            {
                if(Math.Abs(lp.phi)>ONETOL) { Proj.pj_ctx_set_errno(ctx, -20); return lp; }
                else if(lp.phi<0.0) { t=-1.0; lp.phi=-Proj.PI; }
                else { t=1.0; lp.phi=Proj.PI; }
            }
            else
            {
                t=lp.phi;
                lp.phi=2.0*Math.Asin(t);
            }

            lp.lam=RXC*xy.x/(1.0+2.0*Math.Cos(lp.phi)/Math.Cos(0.5*lp.phi));
            lp.phi=RC*(t+Math.Sin(lp.phi));
            if(Math.Abs(lp.phi)>1.0)
            {
                if(Math.Abs(lp.phi)>ONETOL) { Proj.pj_ctx_set_errno(ctx, -20); return lp; }
                else lp.phi=lp.phi<0.0?-Proj.HALFPI:Proj.HALFPI;
            }
            else lp.phi=Math.Asin(lp.phi);

            return lp;
        }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:32,代码来源:pj_mbtfpq.cs

示例6: inverse

 LP inverse(XY xy)
 {
     LP lp;
     lp.phi=xy.y*Proj.DEG_TO_RAD*a;
     lp.lam=xy.x*Proj.DEG_TO_RAD*a;
     return lp;
 }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:7,代码来源:pj_latlong_deg.cs

示例7: s_inverse

		// spheroid
		LP s_inverse(XY xy)
		{
			double yc = xy.y;

			// make sure y is inside valid range
			if (xy.y > MAX_Y) xy.y = MAX_Y;
			else if (xy.y < -MAX_Y) xy.y = -MAX_Y;

			for (;;)
			{ // Newton-Raphson
				double y2 = yc * yc;
				double f = yc * (K1 + y2 * y2 * (K2 + y2 * (K3 + K4 * y2))) - xy.y;
				double fder = C1 + y2 * y2 * (C2 + y2 * (C3 + C4 * y2));
				double tol = f / fder;
				yc -= tol;

				if (Math.Abs(tol) < EPS11) break;
			}

			LP lp;
			lp.phi = yc;
			lp.lam = xy.x; // longitude

			return lp;
		}
开发者ID:shintadono,项目名称:Free.Ports.Proj4,代码行数:26,代码来源:pj_patterson.cs

示例8: calcdiff

    // calculates how well a color fits at the given coordinates
    float calcdiff(Color[,] pixels, XY xy, Color c)
    {
        // get the diffs for each neighbor separately
        List<float> diffs = new List<float>(8);
        foreach (var nxy in getneighbors(xy))
        {
            diffs.Add(coldiff(pixels[nxy.x, nxy.y], c));
        }

        // average or minimum selection
        if (AVERAGE)
        {
            float sum = 0 ;
            foreach(float i in diffs )
                sum += i;
            return sum / diffs.Count;
        }
        else
        {
            float min = 9999f;
            foreach(float i in diffs )
                min = (min>i)?i:min;
            return min;
        }
    }
开发者ID:AtwoodDeng,项目名称:spaceChange,代码行数:26,代码来源:DrawColorful.cs

示例9: s_inverse

        // spheroid
        LP s_inverse(XY xy)
        {
            LP lp;
            lp.lam=lp.phi=0;

            int i;
            double p=0.5*xy.y;

            for(i=NITER; i>0; i--)
            {
                double c=Math.Cos(0.5*lp.phi);
                double V=(lp.phi-Math.Tan(lp.phi/2)-p)/(1.0-0.5/(c*c));
                lp.phi-=V;
                if(Math.Abs(V)<EPS) break;
            }

            if(i==0)
            {
                lp.phi=p<0.0?-Proj.HALFPI:Proj.HALFPI;
                lp.lam=2.0*xy.x;
            }
            else lp.lam=2.0*xy.x/(1.0+Math.Cos(lp.phi));

            return lp;
        }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:26,代码来源:pj_nell_h.cs

示例10: ContainsPoint

 // Helper Methods
 public bool ContainsPoint(XY p)
 {
     if (p.x > center.x + half.x) return false;
     if (p.y > center.y + half.y) return false;
     if (p.x < center.x - half.x) return false;
     if (p.y < center.y - half.y) return false;
     return true;
 }
开发者ID:snaptothegrid,项目名称:Tilebase,代码行数:9,代码来源:AABB.cs

示例11: CreateScreen

    public void CreateScreen(XY screenCoord)
    {
        if(!IsValidScreenCoord(screenCoord)) return;

        GameObject screenMesh = GenerateScreenMesh(screenCoord);

        _screenMeshes[screenCoord] = screenMesh;
    }
开发者ID:jtuttle,项目名称:voxels,代码行数:8,代码来源:WorldScreenManager.cs

示例12: DestroyScreen

    public void DestroyScreen(XY screenCoord)
    {
        if(!IsValidScreenCoord(screenCoord)) return;

        Destroy(_screenMeshes[screenCoord]);

        _screenMeshes.Remove(screenCoord);
    }
开发者ID:jtuttle,项目名称:voxels,代码行数:8,代码来源:WorldScreenManager.cs

示例13: GetScreenCenter

    public Vector2 GetScreenCenter(XY screenCoord)
    {
        XYZ screenSize = GameData.World.Config.ScreenSize;

        Vector2 corner = GetScreenCorner(screenCoord);

        return corner + new Vector2(screenSize.X / 2, screenSize.Z / 2);
    }
开发者ID:jtuttle,项目名称:voxels,代码行数:8,代码来源:WorldScreenManager.cs

示例14: s_inverse

        // spheroid
        LP s_inverse(XY xy)
        {
            LP lp;
            lp.lam=lp.phi=0;

            lp.phi=xy.y/C_y;
            lp.lam=xy.x/(C_x*(A+Proj.asqrt(1.0-B*lp.phi*lp.phi)));
            return lp;
        }
开发者ID:JoshDullen,项目名称:nproj4,代码行数:10,代码来源:pj_eck3.cs

示例15: DefaultCell

 public DefaultCell(int x, int y, CellState state)
 {
     this.state = state;
     next_state = CellState.Unknown;
     last_state = CellState.Unknown;
     this.location = location;
     location = new XY(x, y);
     hasChanges = false;
 }
开发者ID:ccjjharmon,项目名称:GameOfLife,代码行数:9,代码来源:DefaultCell.cs


注:本文中的XY类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。