示例#1
0
        string BL2xy()
        {
            string res = string.Format("\r\n高斯正算(BL-->xy)\r\n");

            res += "--------------------------------------\r\n";
            res += string.Format("{0,-5} {1,12} {2,12}",
                                 "点名", "B", "L");
            res += string.Format(" {0,10:f4} {1,10:f4} \r\n", "x", "y");
            Gauss  pos = new Gauss(Obs.Datum, Obs.L0);
            double x, y;

            for (int i = 0; i < Obs.Data.Count; i++)
            {
                double B = Obs.Data[i].B;
                double L = Obs.Data[i].L;
                pos.BL2xy(B, L, out x, out y);
                Obs.Data[i].x = x;
                Obs.Data[i].y = y;


                res += string.Format("{0,-5} {1,12} {2,12}",
                                     Obs.Data[i].Name, GeoPro.Rad2Str(B), GeoPro.Rad2Str(L));
                res += string.Format(" {0,10:f4} {1,10:f4}\r\n", x, y);
            }
            return(res);
        }
示例#2
0
        string xy2BL()
        {
            string res = string.Format("\r\n高斯反算(xy-->BL)\r\n");

            res += "--------------------------------------\r\n";
            res += string.Format("{0,-5} {1,10:f4} {2,10:f4}",
                                 "点名", "x", "y");
            res += string.Format(" {0,12} {1,12}\r\n", "B", "L");
            Gauss  pos = new Gauss(Obs.Datum, Obs.L0);
            double B, L;

            for (int i = 0; i < Obs.Data.Count; i++)
            {
                Obs.Data[i].B = 0; Obs.Data[i].L = 0;
                double x = Obs.Data[i].x + 500.0;  //+500
                double y = Obs.Data[i].y + 500.0;  //+500
                pos.xy2BL(x, y, out B, out L);

                res += string.Format("{0,-5} {1,10:f4} {2,10:f4}", Obs.Data[i].Name, x, y);
                res += string.Format(" {0,15}  {1,15}\r\n ", GeoPro.Rad2Str(B), GeoPro.Rad2Str(L));
            }
            return(res);
        }