因为您没有说明您正在使用的编程语言,因此这里有一个来自最近的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)