Re: GPS formulas
- From: mojaveg@xxxxxxxxxxxxxxxxxx (Everett M. Greene)
- Date: Mon, 30 May 2005 08:17:19 PST
Hans-Bernhard Broeker <broeker@xxxxxxxxxxxxxxxxxxxxx> writes:
> 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.
The above formula will cause all sorts of grief for short
distances. Due to (in)accuracy of the acos() function for
small angles, the computed result will be quite erratic
for two points that are very close to each other.
> 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.
.
- Follow-Ups:
- Re: GPS formulas
- From: Hans-Bernhard Broeker
- Re: GPS formulas
- References:
- GPS formulas
- From: Richard Sloan
- Re: GPS formulas
- From: Hans-Bernhard Broeker
- GPS formulas
- Prev by Date: Re: AT91RM9200 low voltage SDRAM...
- Next by Date: Re: FTDI driver installation problems
- Previous by thread: Re: GPS formulas
- Next by thread: Re: GPS formulas
- Index(es):
Relevant Pages
|