所以我有一个点40.894375,-74.172555,我想在它周围创建一个边界。
所以,我给它添加了一个浮点数,现在是parseFloat("0.00002");我生成的点,我希望从它的底部看起来像什么,无论是北,南,东,或者西。但我得到的是一个数英里的点数列表。
这就是我所看到的一个例子:
^
|
5-10 ft
|
<--- 5-10 ft ---- [40.894375,-74.172555] ---- 5-10 ft --->
|
5-10 ft
|
v
有没有人知道我是怎么做到的?
发布于 2014-08-26 07:48:29
我已经翻译了一个php函数(链接),它计算一个GPS点,如果你给它起点,长度,公里和方位。
若要找到您的要点,请使用以下函数
geoDestination([40.894375,-74.172555], 0.003048, 0); //Point 10 ft north
geoDestination([40.894375,-74.172555], 0.003048, 90); //Point 10 ft east
geoDestination([40.894375,-74.172555], 0.003048, 180); //Point 10 ft south
geoDestination([40.894375,-74.172555], 0.003048, 270); //Point 10 ft west
已翻译的php函数
//start is a array [lat, long]
//dist in km
//brng in degrees
function geoDestination(start, dist, brng){
lat1 = toRad(start[0]);
lon1 = toRad(start[1]);
dist = dist/6371.01; //Earth's radius in km
brng = toRad(brng);
lat2 = Math.asin( Math.sin(lat1)*Math.cos(dist) +
Math.cos(lat1)*Math.sin(dist)*Math.cos(brng) );
lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(dist)*Math.cos(lat1),
Math.cos(dist)-Math.sin(lat1)*Math.sin(lat2));
lon2 = fmod((lon2+3*Math.PI),(2*Math.PI)) - Math.PI;
return [toDeg(lat2),toDeg(lon2)];
}
function toRad(deg){
return deg * Math.PI / 180;
}
function toDeg(rad){
return rad * 180 / Math.PI;
}
function fmod(a, b) {
return Number((a - (Math.floor(a / b) * b)).toPrecision(8));
}
发布于 2014-08-27 09:51:17
1分钟经度(N<->S)为1海里= 6076.12英尺,10英尺为0,00164海里(1/6076.12*10)或0,00164为经度1分钟,或(/60) 2,752 e-5度。因此,您需要加/减2,752 e-5到/从长潮增加或减去10英尺。这是大约。你在问题中提到的号码。对于纬度(W<->E)赤道上的1分钟ia 1 NM,高纬度的距离变短(由纬度的余弦)。
https://stackoverflow.com/questions/25499330
复制相似问题