Gold
Gold

Reputation: 62554

help with GPS position

if i have this position: 32.226743,34.747009

and i need to know that i in the range of 10 meter from this position

how to know this ?

(i work on C# Windows-mobile 2005)

thank's in advance

Upvotes: 0

Views: 563

Answers (5)

Belal Ghanem
Belal Ghanem

Reputation: 107

most laguage support fancutions to calculate it .. and i used it before in java and c# This code in c#:

GeoCoordinate sCoord = new GeoCoordinate(88, 88);
        var eCoord = new GeoCoordinate(90, 90);

        return sCoord.GetDistanceTo(eCoord);

Upvotes: 0

ctacke
ctacke

Reputation: 67198

Then use the great-circle distance formula. THough in reality, when looking at such short distances with respect to the planet's radius, a simple 2D euclidean distance between two points is going to be close enough.

Upvotes: 1

fishhead
fishhead

Reputation: 6109

here is a link that might help

Latitude, Longitude, Bearing, Cardinal Direction, Distance, and C#

Upvotes: 1

Henk Holterman
Henk Holterman

Reputation: 273804

I will take the question literally, without trying to guess what you really meant:

  1. you have to get a second position (where you are)
  2. calculate the distance between the 2 locations
  3. check if it is less than 10 meters

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1039488

Once you get the current position you could calculate the distance between those two points and test if it is less than 10 meters.

Upvotes: 3

Related Questions