>My first attempt at a distance calculation (using a floating
point

>implementation of the haversine formula) required 5 trigonometric
function

>calls, two square roots, and several floating point
divisions.

>Something's still not quite right - two points with the same
coordinates

>show a distance of 323 feet. Gotta track that one
down. But it seems to be

>good enough for distances in miles -
everything seems to be within about 10%

>of what it should be.

Have you had a look at the distance
calculation routines we used on the HamHUD? We were very limited in the math
functions on the PIC used it that device, yet Steve still managed to get
pretty accurate distance calculations. The same type of fudge factor concept
was talked about quite extensively when we were trying to get it
all hashed out.

>Now for bearing
calculation. Anyone know how to fake an
arctangent

>calculation?

I wrote a C routine to convert lat/long positions
into the 16 compass rose directions that is used in the HamHUD. Are you
looking to calculate it out to integer degrees, or general compass directions.
Using simple math and comparisons gave us a pretty decent bearing
routine.

James

VE6SRV

I am using the free version of SPAMfighter for private users.

It has
removed 152 spam emails to date.

Paying users do not have this message in
their emails.

Try

SPAMfighter for free
now!