2012-08-14 289 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)