Given an ArcByCenterPoint, defined by:
- center position (lat,lon in WGS84)
- radius (meters)
- startAngle (degrees)
- endAngle (degrees)
how can we compute the position (lat, lon) of start/end points? I'm looking for a formula.
Given an ArcByCenterPoint, defined by:
how can we compute the position (lat, lon) of start/end points? I'm looking for a formula.
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
If you want extreme accuracy try using GeographicLib and the formula in the source code under the hood of the Direct Problem at the "Geodesic calculations for an ellipsoid done right" web page.