897Re: [tracker2] Distance calculation redux
- Aug 31, 2006
point>My first attempt at a distance calculation (using a floating
>implementation of the haversine formula) required 5 trigonometricfunction
>calls, two square roots, and several floating pointdivisions.
coordinates>Something's still not quite right - two points with the same
>show a distance of 323 feet. Gotta track that onedown. 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 howto fake an arctangent
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.JamesVE6SRV
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!
- << Previous post in topic Next post in topic >>