我想知道关于如何找到医院的位置,靠近我的位置
使用Android的,怎么可能呢?,我可以使用谷歌的数据库,获取经纬度值对于医院的位置,怎么可能?
I wanna idea about "How to find Hospital Location near by my location
" using android,How is possible?,can i use google's database for get latitude and longitude value for Hospital location,How is possible?
感谢所有
距离的计算是基于的LatLong数学这样:
Distance calculations are based on LatLong math such that:
距离
本使用了半正矢的公式计算出两点之间的大圆距离 - 也就是,在地球表面的最短距离 - 给点之间的为最乌鸦飞'的距离(忽略任何小山!)。
This uses the ‘haversine’ formula to calculate great-circle distances between the two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills!).
半正矢公式:
R =地球半径(平均半径=6371公里) Δlat= lat2- LAT1 Δlong= long2- long1 一个=sin²(Δlat/ 2)+ COS(LAT1)名为.cos(LAT2).sin²(Δlong/ 2) C = 2.atan2(√A,√(1-A)) D = R.C
R = earth’s radius (mean radius = 6,371km) Δlat = lat2− lat1 Δlong = long2− long1 a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2) c = 2.atan2(√a, √(1−a)) d = R.c
(注意,角度需要在弧度传递到三角函数)。 JavaScript的:
(Note that angles need to be in radians to pass to trig functions). JavaScript:
变种R = 6371; //公里 变种DLAT =(LAT2-LAT1).toRad(); 变种dLon =(lon2-lon1).toRad(); 变种一个= Math.sin(DLAT / 2)* Math.sin(DLAT / 2)+ Math.cos(lat1.toRad())* Math.cos(lat2.toRad())* Math.sin(dLon / 2)* Math.sin(dLon / 2); 变种C = 2 * Math.atan2(的Math.sqrt(a)中,的Math.sqrt(1-a))的; VAR D = R *℃;
var R = 6371; // km var dLat = (lat2-lat1).toRad(); var dLon = (lon2-lon1).toRad(); var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) * Math.sin(dLon/2) * Math.sin(dLon/2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c;
上一篇:我怎样才能了解无证.NET / COM库函数?无证、库函数、NET、COM
下一篇:MongoDB的+天青+安卓:错误:com.mongodb.MongoException:不是说要掌握和重试用完说要、用完、重试、错误