首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

依据Latitude/Longitude 计算方位,距离等

2012-10-16 
根据Latitude/Longitude 计算方位,距离等里面有详细的说明http://www.movable-type.co.uk/scripts/latlong

根据Latitude/Longitude 计算方位,距离等
里面有详细的说明http://www.movable-type.co.uk/scripts/latlong.html
比如计算距离
方法一,

public static String getDirection(float baseAzimuth){String bearingText = "";    if ( (360 >= baseAzimuth && baseAzimuth >= 337.5) || (0 <= baseAzimuth && baseAzimuth <= 22.5) ) bearingText = "N";    else if (baseAzimuth > 22.5 && baseAzimuth < 67.5) bearingText = "NE";    else if (baseAzimuth >= 67.5 && baseAzimuth <= 112.5) bearingText = "E";    else if (baseAzimuth > 112.5 && baseAzimuth < 157.5) bearingText = "SE";    else if (baseAzimuth >= 157.5 && baseAzimuth <= 202.5) bearingText = "S";    else if (baseAzimuth > 202.5 && baseAzimuth < 247.5) bearingText = "SW";    else if (baseAzimuth >= 247.5 && baseAzimuth <= 292.5) bearingText = "W";    else if (baseAzimuth > 292.5 && baseAzimuth < 337.5) bearingText = "NW";        return bearingText;}


都可以在里面找到答案

热点排行