Re: GPS formulas



Richard Sloan <rsloan2003@xxxxxxxxxxx> wrote:
> 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;

Pretty much guaranteed to be wrong at this point already.

Differences between longitudes don't have much of a useful meaning.
First because longitude is circular, and difference across a
wrap-around will yield wild results. Second because the meaning of a
longitude difference changes with latitude. The best way to generate
such formulae is usually to not use longitude and latitude at all, but
3D cartesian coordinates of points either on the unit sphere, or on
the actual earth surface --- those will even be easier to extract from
GPS raw signals, as an extra bonus.

The distance between two such points along the earth's surface is then
roughly

arccos(dotproduct(point1, point2))/R

the length of an arc along the great circle through the two points. I
say "roughly" because earth isn't really a sphere.

Generally, two points on the sphere, together with the center, define
a plane in space. The intersection of that plane with the sphere is a
great-circle, and the shortest path between the two points is part of
it.

--
Hans-Bernhard Broeker (broeker@xxxxxxxxxxxxxxxxxxxxx)
Even if all the snow were burnt, ashes would remain.
.



Relevant Pages

  • 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: Time is a concept
    ... distance away, and then another twice the distance away, and so on, ... Perhaps you weren't taught how to draw field lines with any reasonable ... gravitating mass were a hollow, ... of gravity of a sphere where you need to take account of no fewer than ...
    (sci.physics.relativity)
  • Re: Time is a concept
    ... distance away, and then another twice the distance away, and so on, ... Perhaps you weren't taught how to draw field lines with any reasonable ... gravitating mass were a hollow, ... of gravity of a sphere where you need to take account of no fewer than ...
    (sci.physics.relativity)
  • Re: Time is a concept
    ... distance away, and then another twice the distance away, and so on, ... I wasn't taught how to draw field lines, ... of gravity of a sphere where you need to take account of no fewer than ... in the case of a hollow sphere it is 6. ...
    (sci.physics.relativity)
  • Re: Is the speed of light really constant ?
    ... The rate of acceleration, depending on distance from ... If you paint the inside of sphere with a uniform coat, ... The further away you are, the fainter the star will appear, ...
    (sci.physics.relativity)