GPS formulas



I have been looking for formulas to help me create a special GPS device, I
need to know distance from current position to a point (LAT,LONG) and also I
need a function to let me know when I am passing by a point and if its to
the left, right, ahead, or behind me, and it would be nice to know by how
much.

Below are formula I found on the web and thought would be at least part of
my answer, these were referred to as great circle equations.

I am not a math wiz, I am very good at math, but not to the point I could
come up with these equations myself :-)

Can anyone help with whats required?

Thanks!
Richard.

Now for the distance I have used successfully:
dLAT = LAT1 - LAT2;
dLONG = LONG1 - LONG2;
R = 6731000.0
double dist2(void) {
return R*2*asin(sqrt((sin((dLAT)/2))*(sin((dLAT)/2)) +
cos(LAT1)*cos(LAT2)*(sin((dLONG)/2))*(sin((dLONG)/2))));
}

And for nearing I have used rather unsuccessfully:
double bearing(void) {
C =
fmod(atan2(sin(dLONG)*cos(LAT2),cos(LAT1)*sin(LAT2)-sin(LAT1)*cos(LAT2)*cos(dLONG)),
2*PI);
C = ((C*180)/PI)

return C;
}


.



Relevant Pages

  • GPS formulas
    ... I have been looking for formulas to help me create a special GPS device, ... need to know distance from current position to a point and also I ... these were referred to as great circle equations. ... I am not a math wiz, I am very good at math, but not to the point I could ...
    (sci.math)
  • Re: GPS formulas
    ... >> I have been looking for formulas to help me create a special GPS device, ... >> need to know distance from current position to a point and also I ... > longitude difference changes with latitude. ... > say "roughly" because earth isn't really a sphere. ...
    (comp.arch.embedded)
  • Re: GPS formulas
    ... >I have been looking for formulas to help me create a special GPS device, ... >need to know distance from current position to a point and also I ... Vancouver Power Squadron: http://vancouver.powersquadron.ca ... Prev by Date: ...
    (comp.arch.embedded)
  • GPS formulas
    ... I have been looking for formulas to help me create a special GPS device, ... need to know distance from current position to a point and also I ... And for nearing I have used reather unsucessfully: ... Prev by Date: ...
    (sci.math)