Esempio n. 1
0
        public void TestxytoBl()
        {
            {
                //B = 21 ◦ 58 ′ 47.0845 ′′ ,L = 113 ◦ 25 ′ 31.4880 ′′ ,

                IProj proj = new GaussProj(Spheroid.CreateBeiJing1954());

                double x = 2433586.692, y = 250547.403;
                proj.xytoBl(x, y, out double B, out double l, out _, out _);

                B = SurMath.RADtoDMS(B);
                l = SurMath.RADtoDMS(l);

                Assert.AreEqual(21.58470845, B, 1e-8);
                Assert.AreEqual(2.25314880, l, 1e-8);
            }
        }
Esempio n. 2
0
        public void TestRAD2DMS()
        {
            int    d, m;
            double s;

            SurMath.RADtoDMS(0.410855952558766,
                             out d, out m, out s);
            Assert.AreEqual <int>(23, d);
            Assert.AreEqual <int>(32, m);
            Assert.AreEqual(25.12345, s, 1e-8);


            SurMath.RADtoDMS(-0.410855952558766,
                             out d, out m, out s);
            Assert.AreEqual <int>(-23, d);
            Assert.AreEqual <int>(-32, m);
            Assert.AreEqual(-25.12345, s, 1e-8);
            //Assert.AreEqual("-23°32′25.12345″", aa);
        }