2012-04-20 117 views
1

我有緯度,經度和半徑。你能幫我找到 從給定的點(經度和緯度)和半徑的另一個緯度和經度。從給定點和半徑計算經度和緯度

由於提前

+0

2個問題:你想找到任何一個其他的點或怎麼回事;和(2)你有什麼嘗試? – 2012-04-20 13:35:14

+0

如果您已經獲得拉特和長時間,您有什麼「其他」經緯度? – 2012-04-20 13:36:02

+0

** *其他經緯度* ...? *什麼*其他緯度經度? – aioobe 2012-04-20 13:36:09

回答

1

你是不是想看看另一個緯度和經度是你最初的緯度和經度的一定半徑範圍內?如果是這樣,請查看this other StackOverflow post

1

您將需要比點和半徑更多的信息。你也將需要圓圈中的點的角度。

使用半徑和角度,你必須應用法則和繪製和三維尺寸半徑,高度和寬度的虛構三角形。高度和寬度將爲您提供與當前經緯度的距離。

例如:

for (int angle = 0; angle < 360; angle++){ 
    double x = getDistanceX(radius, angle); 
    double y = getDistanceY(radius, angle); 
    if (angle > 180) 
     x *= -1; 
    if (angle > 90 && angle < 270) 
     y *= -1; 
    double newLatitude = getCalculateLatitude(latitude, x); 
    double newLongitude = getCalculateLatitude(longitude, y); 
} 
相關問題