已知起点经纬度及两点间距离、方位角如何求出终点经纬度?(附C#与python代码)

本文介绍了如何根据起点经纬度、距离和方位角计算出终点的经纬度,提供了C#和Python的实现代码,并引用了Stack Overflow和腾讯云的相关资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 double radiusEarthKilometres = 6371.01f; //地球半径,以km为单位
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Hironono小野

谢谢你的鼓励!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值