c#.Net中的Circlular Geofencing(Circlular Geofencing in c#.Net)

编程入门 行业动态 更新时间:2024-10-24 10:19:44
c#.Net中的Circlular Geofencing(Circlular Geofencing in c#.Net)

我在Bing地图中画了一个圆圈。 现在我需要编写一个点(纬度,经度)是在圆圈内部还是外部的代码?

c#.Net中是否有任何算法代码?

I have drawn a circle in Bing maps. Now I need to write code for whether a point (latitude, longitude) is inside or outside of the circle?

Is there any algorithmic code in c#.Net?

最满意答案

只需计算distance between the center of the circle and your current coordinate的distance between the center of the circle and your current coordinate ,并将此距离与圆半径进行比较(距离<=半径表示坐标位于圆内)。

要计算两点之间的距离,请使用Haversine公式 。

你会在这里找到一个C#实现。

Just compute the distance between the center of the circle and your current coordinate, and compare this distance to the circle radius (distance <= radius means the coordinate is inside the circle).

To compute the distance between two points, use the Haversine formula.

You'll find a C# implementation here.

更多推荐

本文发布于:2023-08-03 13:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390773.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Net   Circlular   Geofencing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!