Re: GPS formulas
- From: Hans-Bernhard Broeker <broeker@xxxxxxxxxxxxxxxxxxxxx>
- Date: 29 May 2005 15:45:52 GMT
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.
.
- Follow-Ups:
- Re: GPS formulas
- From: Everett M. Greene
- Re: GPS formulas
- References:
- GPS formulas
- From: Richard Sloan
- GPS formulas
- Prev by Date: ATtiny13 replaces tiny11/tiny12?
- Next by Date: Re: GPS formulas
- Previous by thread: Re: GPS formulas
- Next by thread: Re: GPS formulas
- Index(es):
Relevant Pages
|