Esempio n. 1
0
        private void TestAlogrithms()
        {
            GPSPoint p1 = new GPSPoint(117.282203, 31.86491, 0);
            GPSPoint p2 = new GPSPoint(117.281501, 31.86434, 0);
            //答案是91.65m
            double distance1 = p1.DistanceToOtherPointOnEarth(p2);

            double[] xy1       = p1.ProjectedPoint;
            double[] xy2       = p2.ProjectedPoint;
            double   distance2 = Math.Sqrt((xy1[0] - xy2[0]) * (xy1[0] - xy2[0]) + (xy1[1] - xy2[1]) * (xy1[1] - xy2[1]));

            MessageBox.Show(distance1 + "----" + distance2);
        }