예제 #1
0
        /// <summary>
        /// 将大地坐标转换为高斯平面坐标
        /// </summary>
        /// <param name="gBLH">大地坐标</param>
        /// <returns>高斯平面坐标</returns>
        private GeoxyH ConvertBLHToxyH(GeoBLH gBLH)
        {
            double _h      = gBLH.gH;
            double X       = GeodeticCalculate.LengthOfMeridian(re, gBLH.gB);
            double N       = GeodeticCalculate.UnitaryCircleRadius(re, gBLH.gB);
            double centerL = (gBLH.gL + 3600 * 360.0) % (3600 * 360.0);
            int    beltNo  = (int)(centerL / (6.0 * 3600)) + 1;

            centerL = 6.0 * 3600 * beltNo - 3.0 * 3600;
            double dl    = gBLH.gL - centerL;
            double sinB  = Math.Sin(gBLH.gB / Angle.Rou);
            double cosB  = Math.Cos(gBLH.gB / Angle.Rou);
            double t2    = Math.Pow(Math.Tan(gBLH.gB / Angle.Rou), 2);
            double yita2 = re.firste2 * cosB * cosB;
            double x1    = N * sinB * cosB * dl * dl / (2.0 * Angle.Rou * Angle.Rou);
            double x2    = N * sinB * Math.Pow(cosB, 3) * (5 - t2 + 9 * yita2 + 4 * yita2 * yita2) * Math.Pow(dl, 4) / (24.0 * Math.Pow(Angle.Rou, 4));
            double x3    = N * sinB * Math.Pow(cosB, 5) * (61 - 58 * t2 + t2 * t2) * Math.Pow(dl, 6) / (720.0 * Math.Pow(Angle.Rou, 6));
            double y1    = N * cosB * dl / Angle.Rou;
            double y2    = N * Math.Pow(cosB, 3) * (1 - t2 + yita2) * Math.Pow(dl, 3) / (6.0 * Math.Pow(Angle.Rou, 3));
            double y3    = N * Math.Pow(cosB, 5) * (5 - 18 * t2 + t2 * t2 + 14 * yita2 - 58 * t2 * yita2) * Math.Pow(dl, 5) / (120.0 * Math.Pow(Angle.Rou, 5));
            double _x    = X + x1 + x2 + x3;
            double _y    = y1 + y2 + y3 + 500000.0 + beltNo * 1000000.0;

            return(new GeoxyH(_x, _y, _h));
        }
예제 #2
0
        /// <summary>
        /// 将大地坐标转换为空间直角坐标
        /// </summary>
        /// <param name="gblh">大地坐标</param>
        /// <returns>空间直角坐标</returns>
        private GeoXYZ ConvertBLHToXYZ(GeoBLH gblh)
        {
            double n    = GeodeticCalculate.UnitaryCircleRadius(re, gblh.gB);
            double cosB = Math.Cos(gblh.gB / Angle.Rou);
            double sinB = Math.Sin(gblh.gB / Angle.Rou);
            double cosL = Math.Cos(gblh.gL / Angle.Rou);
            double sinL = Math.Sin(gblh.gL / Angle.Rou);
            double _X   = (n + gblh.gH) * cosB * cosL;
            double _Y   = (n + gblh.gH) * cosB * sinL;
            double _Z   = (n * (1 - re.firste2) + gblh.gH) * sinB;

            return(new GeoXYZ(_X, _Y, _Z));
        }
예제 #3
0
        /// <summary>
        /// 将高斯平面坐标转化为大地坐标
        /// </summary>
        /// <param name="gxyH">高斯平面坐标</param>
        /// <returns>大地坐标</returns>
        private GeoBLH ConvertxyHToBLH(GeoxyH gxyH)
        {
            int    beltNo = (int)(gxyH.gy / 1000000.0);
            double y      = gxyH.gy % 1000000.0 - 500000.0;
            double Bf     = GeodeticCalculate.LengthOfMeridianAntiCaculate(re, gxyH.gx);
            double tf     = Math.Tan(Bf / Angle.Rou);
            double cosbf  = Math.Cos(Bf / Angle.Rou);
            double yitaf  = re.firste2 * cosbf * cosbf;
            double Mf     = GeodeticCalculate.MeridianCircleRadius(re, Bf);
            double Nf     = GeodeticCalculate.UnitaryCircleRadius(re, Bf);
            double b1     = -(tf * Math.Pow(y, 2) / (2.0 * Mf * Nf));
            double b2     = tf * (5 + 3 * Math.Pow(tf, 2) + yitaf - 9 * yitaf * tf * tf) * Math.Pow(y, 4) / (24 * Mf * Math.Pow(Nf, 3));
            double b3     = -(tf * Math.Pow(y, 6)) * (61 + 90 * tf * tf + 45 * tf * tf * tf * tf) / (720 * Mf * Math.Pow(Nf, 5));
            double B      = Bf / Angle.Rou + b1 + b2 + b3;
            double L      = y / (Nf * cosbf) - Math.Pow(y, 3) * (1 + 2 * tf * tf + yitaf) / (6 * Math.Pow(Nf, 3) * cosbf) + Math.Pow(y, 5) * (5 + 28 * tf * tf + 24 * Math.Pow(tf, 4) + 6 * yitaf + 8 * yitaf * tf * tf) / (120 * Math.Pow(Nf, 5) * cosbf);
            double _B     = Bf + (b1 + b2 + b3) * Angle.Rou;
            double _L     = L * Angle.Rou + beltNo * 6.0 * 3600 - 3.0 * 3600;
            double _H     = gxyH.gH;

            return(new GeoBLH(_B, _L, _H));
        }
예제 #4
0
        /// <summary>
        /// 将空间直角坐标转换为大地坐标
        /// </summary>
        /// <param name="gXYZ">空间直角坐标</param>
        /// <returns>大地坐标</returns>
        private GeoBLH ConvertXYZToBLH(GeoXYZ gXYZ)
        {
            double l = Math.Atan2(gXYZ.gY, gXYZ.gX);

            l = l > 0 ? l : 2 * Math.PI + l;
            double tanB0 = gXYZ.gZ / Math.Sqrt(gXYZ.gX * gXYZ.gX + gXYZ.gY * gXYZ.gY);
            double tanB  = 0;

            do
            {
                tanB = (gXYZ.gZ + re.a * re.firste2 * tanB0 / Math.Sqrt(1 + tanB0 * tanB0 - re.firste2 * tanB0 * tanB0)) / Math.Sqrt(gXYZ.gX * gXYZ.gX + gXYZ.gY * gXYZ.gY);
                double temp = tanB0;
                tanB0 = tanB;
                tanB  = temp;
            }while (Math.Abs(tanB - tanB0) > 1.0e-11);
            double _B = Math.Atan(tanB) * Angle.Rou;
            double _L = l * Angle.Rou;
            double n  = GeodeticCalculate.UnitaryCircleRadius(re, _B);
            double _H = Math.Sqrt(gXYZ.gX * gXYZ.gX + gXYZ.gY * gXYZ.gY) / Math.Cos(_B / Angle.Rou) - n;

            return(new GeoBLH(_B, _L, _H));
        }