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: 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)
  • Re: Distance Between 2 Randomly-chosen Points on a Sphere
    ... >> every point at a distance of x from the pole, there is a point mirrored at ... It seems that of two random points on the unit sphere, ... on that circle is sqrt. ... uniform random on an open cylinder, ...
    (sci.math)
  • Re: On the controversy about the Schwarzschild radius and black holes
    ... distance from the surface of the Earth is zero at the surface of the Earth. ... sphere of area 16pi m^2 -- and not the distance from a point. ... Sure -- because that's the range in which the coordinate system is defined.. ...
    (sci.physics.relativity)
  • Re: "Tired" light
    ... Distance is an illusion to soothe the masses. ... A sphere has an edge, assuming you infer that we live inside the sphere. ... distant objects that are blueshifted. ... But the red shift with distance does not describe any anomalies along that ...
    (sci.astro)