Search code examples
geometrygisformulagml-geographic-markup-lan

How to compute coordinates of start/end points of a ArcByCenterPoint?


Given an ArcByCenterPoint, defined by:

  1. center position (lat,lon in WGS84)
  2. radius (meters)
  3. startAngle (degrees)
  4. endAngle (degrees)

how can we compute the position (lat, lon) of start/end points? I'm looking for a formula.


Solution

  • You can find appropriate formulas in the section Destination point given distance and bearing from start point here
    Excerpt:

    Formula:
    φ2 = asin( sin φ1 ⋅ cos δ + cos φ1 ⋅ sin δ ⋅ cos θ )     
    λ2 = λ1 + atan2( sin θ ⋅ sin δ ⋅ cos φ1, cos δ − sin φ1 ⋅ sin φ2 )
    where   
    φ is latitude, λ is longitude, 
    θ is the bearing (clockwise from north), 
    δ is the angular distance d/R; 
    d being the distance travelled, R the earth’s radius