views:

180

answers:

2

i need a peace of code in C# that can calc the distance between 2 points in a map that has a wsg1984 format

+1  A: 

You can use the Haversine forumla, or the spherical law of cosines. See http://www.movable-type.co.uk/scripts/latlong.html for formulas. Should be simple to translate to C#

rlovtang
A: 

transform to metric system 3395, and calculate distance using known formula distance = sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2)

It is not exact, but it suits for 99% cases.

Igor Shubovych