Loading ...
Sorry, an error occurred while loading the content.

898RE: [tracker2] Distance calculation redux

Expand Messages
  • scott@opentrac.org
    Aug 31, 2006
    • 0 Attachment
      I want to get the bearing calculated down to at least a couple of degrees, since it'll potentially be used for automatic antenna aiming (e.g., tracking an ATV-equipped plane.)

      From: tracker2@yahoogroups.com [mailto:tracker2@yahoogroups.com] On Behalf Of James Ewen
      Sent: Thursday, August 31, 2006 4:34 PM
      To: tracker2@yahoogroups.com
      Subject: Re: [tracker2] Distance calculation redux

      >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
      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.

      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!

    • Show all 8 messages in this topic