Get lat/long given current point, distance and bearing.
1、计算公式:
lat2 = asin(sin(lat1)*cos(d/R) + cos(lat1)*sin(d/R)*cos(θ))
lon2 = lon1 + atan2(sin(θ)*sin(d/R)*cos(lat1), cos(d/R)−sin(lat1)*sin(lat2))
其中,
-
asin = arc sin()
-
d = distance (in any unit)
-
R = Radius of the earth (in the same unit as above)
and hence d/r = is the angular distance (in radians)
- atan2(a,b) = arc tan(b/a)
- θ is the bearing (in radians, clockwise from north);
2、C#代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
const dou