2012-08-14 16 views
2

給定一個位置(lat,lng),我想在Azimuthal Equidistant Projection中獲得它的座標。公式解釋here方位角等距投影中的公式

下面是該網頁的屏幕截圖。 formulas

在該頁的結束,它指出 c

看起來給出的任何位置(緯度[-Pi/2,+π/ 2],LNG [0,+ 2PI)),和投影中心(latCenter,lngCenter),我可以在地圖上計算其座標(x,y),並且由於沒有提供地圖半徑,所以x和y的值將落在[-1, +1]或[-Pi,+ Pi]。

我的問題是,公式中的c是什麼?如果它是從(x,y)計算的值,那麼它如何用來計算(x,y)?

有人能幫我理解這些公式嗎?

回答

3

從lat/long投影到x,y時,使用方程4計算c。公式7用於計算逆,即從x,y到lat/long。爲了您的目的,製作地圖,忽略方程式7.

c是從投影中心(phi0,lambda0)到另一個點(phi ,lambda)。

1

因爲您沒有說明您正在使用的編程語言,因此這裏有一個來自最近的blogpost的F#實現。

open System 
module AzimuthalEquidistantProjection = 

    let inline degToRad d = 0.0174532925199433 * d; // (1.0/180.0 * Math.PI) * d 

    let project centerlon centerlat lon lat = 
     // http://mathworld.wolfram.com/AzimuthalEquidistantProjection.html 
     // http://www.radicalcartography.net/?projectionref 
     let t:float = degToRad lat 
     let l:float = degToRad lon 
     let t1 = degToRad centerlat // latitude center of projection 
     let l0 = degToRad centerlon // longitude center of projection 
     let c = Math.Acos ((sin t1) * (sin t) + (cos t1) * (cos t) * (cos (l-l0))) 
     let k = c/(sin c) 
     let x = k * (cos t) * (sin (l-l0)) 
     let y = k * (cos t1) * (sin t) - (sin t1) * (cos t) * (cos (l-l0)) 
     (x, y) 

Other versions (F# with units of measure, Python and Julia)