2011-01-24 124 views
1

我不需要編程語言的幫助,我需要某人的幫助來計算特定距離的點的GPS座標,即相距22英尺一圈的圓周。我知道開始的GPS座標和半徑。我非常確定半束縛,或者餘弦的球形定律有答案,但是從我使用任何三角公式開始,我已經很長時間了,我無法弄清楚。我正在使用十進制度,並在這個vb.net編程。如果有人能夠幫我解決這個問題,這將是一個很大的幫助。沿着已知距離的已知圓的圓周計算經度和緯度

+0

您需要先定義你的假設。哪個地球模型(球形,橢圓球體,基準面和橢球面)?地理座標或投影座標? – Benjamin 2011-01-24 17:49:03

+0

感謝所有的答案,我會對小圓方程進行一些研究。我可能可以使用UTM座標,因爲我使用這些點爲收益圖構建shp文件,絕對地理位置不如一致性重要。你能告訴我如何用UTM座標來做到這一點嗎?如果我需要使用十進制度數,我發現相當複雜的公式轉換回十進制度。 – gw73 2011-01-26 13:59:32

回答

0

據我所知,您有:

  1. 座標 圓周的中心。
  2. 之間的距離 圈的圓周上的兩點。
  3. 圓周半徑。

在我看來,這是不足以計算其他點的座標。您應該擁有至少一個點座標,因爲我們只能猜測點在圓周上的位置。

0

這裏的基本算法:

Calculate the angular measure whose arc length is 22 feet, with the given radius 
numPoints = Math.PI * 2/angularMeasure 
for i in range(numPoints): 
    calculate proportion around the circle we are, in terms of degrees or radians 
    calculate the location of the endpoint of a great circle or rhumb arc from the center point moving in the specific azimuth direction (from the proportion around the circle) the given radius 

最後這一點是最難的部分。這裏的代碼來自世界風SDK(提供:http://worldwind.arc.nasa.gov/java/)(注意:你必須計算的角度,你可以做很容易給定半徑的地球/周長方面半徑)

/* 
Copyright (C) 2001, 2006 United States Government 
as represented by the Administrator of the 
National Aeronautics and Space Administration. 
All Rights Reserved. 
*/ 
/** 
* Computes the location on a rhumb line with the given starting location, rhumb azimuth, and arc distance along the 
* line. 
* 
* @param p   LatLon of the starting location 
* @param rhumbAzimuth rhumb azimuth angle (clockwise from North) 
* @param pathLength arc distance to travel 
* 
* @return LatLon location on the rhumb line. 
*/ 
public static LatLon rhumbEndPosition(LatLon p, Angle rhumbAzimuth, Angle pathLength) 
{ 
    if (p == null) 
    { 
     String message = Logging.getMessage("nullValue.LatLonIsNull"); 
     Logging.logger().severe(message); 
     throw new IllegalArgumentException(message); 
    } 
    if (rhumbAzimuth == null || pathLength == null) 
    { 
     String message = Logging.getMessage("nullValue.AngleIsNull"); 
     Logging.logger().severe(message); 
     throw new IllegalArgumentException(message); 
    } 

    double lat1 = p.getLatitude().radians; 
    double lon1 = p.getLongitude().radians; 
    double azimuth = rhumbAzimuth.radians; 
    double distance = pathLength.radians; 

    if (distance == 0) 
     return p; 

    // Taken from http://www.movable-type.co.uk/scripts/latlong.html 
    double lat2 = lat1 + distance * Math.cos(azimuth); 
    double dPhi = Math.log(Math.tan(lat2/2.0 + Math.PI/4.0)/Math.tan(lat1/2.0 + Math.PI/4.0)); 
    double q = (lat2 - lat1)/dPhi; 
    if (Double.isNaN(dPhi) || Double.isNaN(q) || Double.isInfinite(q)) 
    { 
     q = Math.cos(lat1); 
    } 
    double dLon = distance * Math.sin(azimuth)/q; 
    // Handle latitude passing over either pole. 
    if (Math.abs(lat2) > Math.PI/2.0) 
    { 
     lat2 = lat2 > 0 ? Math.PI - lat2 : -Math.PI - lat2; 
    } 
    double lon2 = (lon1 + dLon + Math.PI) % (2 * Math.PI) - Math.PI; 

    if (Double.isNaN(lat2) || Double.isNaN(lon2)) 
     return p; 

    return new LatLon(
     Angle.fromRadians(lat2).normalizedLatitude(), 
     Angle.fromRadians(lon2).normalizedLongitude()); 
} 
0

你正在尋找所謂的「小圈子」的方程式。查看this book獲取小圓的方程和該小圓的圓弧長方程。但是,因爲您的距離太小,您可以考慮將您的區域放平並使用更簡單的幾何體。使用UTM座標將使計算比使用緯度/經度更簡單。

haversine公式涉及到大圓,而不是小圓圈......

相關問題