埃德威廉斯的航空公式http://williams.best.vwh.net/avform.htm是一个很好的,方便的地方开始。我经常参考http://movable-type.co.uk/scripts/latlong.html。
我猜你需要某种向量(你的问题有点不清楚)。
我使用什么(在C,而不是Java)来计算出修正径向距离是:
void polarToLatLong(double lat, double lon, double dist, double radial,
double *outlat, double *outlon) {
if (!dist) { // distance zero, so just return the point
*outlat = lat;
*outlon = lon;
}
else if (lat > 89.9999) { // North Pole singularity. Dist is in NM.
*outlat = 90 - dist/60;
*outlon = fmod(radial + 180) - 180;
}
else { // normal case
double sinlat, coslon;
dist /= 3442; // = Earth's radius in nm (not WGS84!)
sinlat = Sin(lat) * cos(dist) + Cos(lat) * sin(dist) * Cos(radial);
*outlat = Arcsin(sinlat);
coslon = (cos(dist) - Sin(lat) * sinlat)/(Cos(lat) * Cos(*outlat));
*outlon = lon + (Sin(radial) >= 0 : -1 : 1) * Arccos(coslon);
}
}
在上面的代码Sin()
,用一个大写S,只是一个sin()
包装为度:
#define CLAMP(a,x,b) MIN(MAX(a, x), b) // GTK+ GLib version slightly different
double Sin(double deg) {return sin(deg * (PI/180));} // wrappers for degrees
double Cos(double deg) {return cos(deg * (PI/180));}
double Arcsin(double x) {return asin(CLAMP(-1, x, 1)) * (180/PI);}
double Arccos(double x) {return acos(CLAMP(-1, x, 1)) * (180/PI);}
看到这个[答案](http://stackoverflow.com/questions/1253499/simple-calculations-for-working-with-lat-lon-km-distance/1253545#1253545) – TheWhiteRabbit
“小数距离”是什么意思? –
我不说“小数点距离”,而是“小数点”。这就是我的意思:http://en.wikipedia.org/wiki/Decimal_degrees – WillyRobert