Calculating the distance between 2 points in c#

后端 未结 4 1796
借酒劲吻你
借酒劲吻你 2020-12-18 04:41

I am trying to sort out a method to calculate the distance between 2 points in c#.

This is the code I have been trying though I fear the answer I get is not correct.

4条回答
  •  忘掉有多难
    2020-12-18 05:09

    You can use DbGeography for spatial calculation. It has DbGeography.Distance method which is used to calculate the distance between two gps points.

    Otherwise, try Ref: Harversine Formula to calculate the distance between two points.

提交回复
热议问题