Question : Caculate GPS coordinate using a reference GPS coordinate

Actually what I am trying to do is map a particualr area by using some single reference gps coordinate.
Say I am standing in the middle of the house having GPS receive in my hand. It gives me a the current gps coordinate and I saves it in db or something. Now what I want to have some kind of algorithm which can detect if the user is within particular radius of the reference point?
Seems to be a simple mathematics but i dont have any prior knowladge of what kind of data gps receiver returns, means can we apply mathematics directly on the gps coordinates?

Actually I am working on location aware system and need to some how find if user is in office or home.

Answer : Caculate GPS coordinate using a reference GPS coordinate

you can do it with simple math. First you have to convert your coordinates to pure degrees:
For example, latitude 15 deg 40 min 30 sec will be:
15+40/60+30/3600 = 15.675 degrees

so, you need 2 coordinate pairs, in pure degrees. To calculate "distance to origin", just apply phytagoras:

dd = sqrt((lat - lat0)^2 + (long - long0)^2)

the distance is expressed in degrees, to convert to meters:

dm = d * 60 * 1852

Random Solutions  
 
programming4us programming4us