将距离换算成经纬度,有误差。 

           //将相对于起点的距离转换为经纬度,distance代表到点的距离,angle代表方位角度
        private string ConvertDistanceToLogLat(float distance, string logLatPtStr, double angle)
        {
            string logLat = null;
            string[] temp_Arrary = logLatPtStr.Split(',');
            double lng1 = ConvertLongiToDouble(temp_Arrary[0].Replace("(",""));
            double lat1 = ConvertLongiToDouble(temp_Arrary[1].Replace(")",""));
            double lon = lng1 + (distance * Math.Sin(angle* Math.PI / 180)) / (111 * Math.Cos(lat1 * Math.PI / 180));//将距离转换成经度的计算公式
            double lat = lat1 + (distance * Math.Cos(angle* Math.PI / 180)) / 111;//将距离转换成纬度的计算公式
            string logStr = ConvertLogLatToString(lon);
            string latStr = ConvertLogLatToString(lat);
            logLat = "(" + logStr + "," + latStr + ")";
            return logLat;
        }

posted on 2013-12-18 18:57  未雨愁眸  阅读(580)  评论(0编辑  收藏  举报